Issue 32019: Interactive shell doesn't work with readline bracketed paste (original) (raw)

Here are the steps to reproduce this:

set enable-bracketed-paste on

to your ~/.inputrc

a = 1 a

You get something like

a = 1 a File "", line 1 a

^

SyntaxError: multiple statements found while compiling a single statement

It does work, however, if you paste something that has a newline but is a single statement, like

(1, 2)

Fixing this in the right way might not be so easy, due to the way that compile('single') is over-engineered. A simple fix would be to disable bracketed paste in the Python shell.

I tested this with Python 3.6.3. I was not able to get the git master to compile, so I couldn't test it there.