[issue42819] readline 8.1 enables the bracketed paste mode by default

STINNER Victor report at bugs.python.org
Mon Feb 15 05:17:49 EST 2021


STINNER Victor <vstinner at python.org> added the comment:

There are different things:

* Bracketed paste mode prevents to execute malicious command copied from evil internet web pages
* Python REPL is not really convenient in the bracked paste mode: bpo-39820
* Users are not used to the bracketed mode which gives a surprising behavior in Python REPL
* Copy/paste in a shell running in a graphical terminal is fine in bracketed mode, since users running a shell are used to modify a command before running and to run manually a command by pressing ENTER
* The bracketed paste mode causes test failures in applications (like pytest test suite) which doesn't support it.
* It is not easy/convenient to opt-out for the bracketed paste mode.

For all these reasons, it sounds reasonable to disable the readline bracketed paste mode by default in Python, even if it's enabled explicitly in ~/.inputrc.

If an user opts in for the bracketed paste mode, it is more likely to prevent running malicious commands in a shell, rather than not executing immediately commands executed in Python.

Once the bpo-39820 will be fixed, we can reconsider to leave the bracketed paste mode default unchanged (no longer disable it explicitly).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42819>
_______________________________________


More information about the Python-bugs-list mailing list