Skip to content

Conversation

@dtrodrigues
Copy link
Contributor

@dtrodriguesdtrodrigues commented Jan 5, 2021

This prevents bracketed paste from being enabled in the interactive interpreter so that paste works as expected.

https://bugs.python.org/issue42819

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@dtrodrigues

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@dtrodriguesdtrodriguesforce-pushed the bpo-42819-readline-bracketed-paste branch from dea83c3 to 838a248CompareJanuary 6, 2021 01:36
@dtrodrigues
Copy link
ContributorAuthor

I rebased and force-pushed now that #24110 has been merged to fix the broken docs so that CI will pass on this PR.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the stale Stale PR or inactive for long period of time. label Feb 6, 2021
@dtrodrigues
Copy link
ContributorAuthor

(in response to stale label) This issue still exists in Python so the PR is relevant.

@github-actionsgithub-actionsbot removed the stale Stale PR or inactive for long period of time. label Feb 7, 2021
@hroncok
Copy link
Contributor

hroncok commented Feb 13, 2021

I'll test this.

In the meantime, could you please explain why is the addition needed at two different places? Thanks.

(Note that I am not familiar with readline or the way Python uses it, I'm just the Fedora Python maintainer who saw your email on the python-dev list and realized that this also affects Fedora because we have updated as well and I've alreadybeenhitby that.)

@hroncok
Copy link
Contributor

I've applied this patch to Python 3.9.1 in Fedora Rawhide. This fixes the problem.

Before:

Python 3.9.1 (default, Jan 27 2021, 00:00:00) [GCC 11.0.0 20210123 (Red Hat 11.0.0-0)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1+2 3+4 5+6 File "<stdin>", line 1 1+2 3+4 5+6 ^ SyntaxError: multiple statements found while compiling a single statement 

After:

Python 3.9.1 (default, Jan 27 2021, 00:00:00) [GCC 11.0.0 20210210 (Red Hat 11.0.0-0)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1+2 3 >>> 3+4 7 >>> 5+6 11 >>> 

@dtrodrigues
Copy link
ContributorAuthor

The setting needs to be disabled after each call to rl_read_init_file in case a user manually has enabled bracketed paste within their inputrc file.

One is for when read_init_file is called from Python and the other is part of the module initialization.

Copy link
Contributor

@hroncokhroncok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog entry could explain why is this needed a bit. Otherwise looks good to me, it fixes the problem. Thanks!

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor formatting remarks, apart of that it LGTM

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @hroncok: do you want to review the updated PR?

@hroncok
Copy link
Contributor

Nope, I'm good. Thanks

@hroncok
Copy link
Contributor

Label it with the backport labels for miss Islington maybe?

@miss-islington
Copy link
Contributor

Thanks @dtrodrigues for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @dtrodrigues for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-24545 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 15, 2021
(cherry picked from commit 755f3c1) Co-authored-by: Dustin Rodrigues <[email protected]>
@bedevere-bot
Copy link

GH-24546 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 15, 2021
(cherry picked from commit 755f3c1) Co-authored-by: Dustin Rodrigues <[email protected]>
@vstinner
Copy link
Member

Thanks @dtrodrigues! I merged your PR and I'm backporting it to 3.8 and 3.9 branches.

miss-islington added a commit that referenced this pull request Feb 15, 2021
(cherry picked from commit 755f3c1) Co-authored-by: Dustin Rodrigues <[email protected]>
vstinner pushed a commit that referenced this pull request Feb 16, 2021
(cherry picked from commit 755f3c1) Co-authored-by: Dustin Rodrigues <[email protected]> Co-authored-by: Dustin Rodrigues <[email protected]>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@dtrodrigues@the-knights-who-say-ni@hroncok@miss-islington@bedevere-bot@vstinner