This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dtrodrigues
Recipients dtrodrigues
Date 2021-01-03.20:52:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609707155.89.0.22999518491.issue42819@roundup.psfhosted.org>
In-reply-to
Content
Readline 8.1 enables bracketed paste by default. Package managers like Homebrew for macOS and distributions like Arch Linux which use the latest version of readline (released December 2020) now have new behavior when pasting multiline strings into the python REPL. Disabling bracketed paste on 8.1 reverts to the expected behavior, and enabling bracketed paste on 8.0 also reproduces the behavior. Further information in https://github.com/Homebrew/homebrew-core/issues/68193

Example with bracketed paste on:
$ cat in
1+2
3+4
5+6

$ pbcopy < in
$ /usr/local/Cellar/python\@3.9/3.9.1_3/bin/python3
Python 3.9.1 (default, Dec 28 2020, 11:22:14) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
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
>>> 



Example with it off:
$ /usr/local/bin/python3
Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:10:52) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
3
>>> 3+4
7
>>> 5+6
11
>>>
History
Date User Action Args
2021-01-03 20:52:35dtrodriguessetrecipients: + dtrodrigues
2021-01-03 20:52:35dtrodriguessetmessageid: <1609707155.89.0.22999518491.issue42819@roundup.psfhosted.org>
2021-01-03 20:52:35dtrodrigueslinkissue42819 messages
2021-01-03 20:52:35dtrodriguescreate