https://github.com/python/cpython/commit/77607753759fee7a5d2d39b4c98a04d59bc0efcc commit: 77607753759fee7a5d2d39b4c98a04d59bc0efcc branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: encukou <[email protected]> date: 2026-01-14T10:56:18+01:00 summary:
[3.13] gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142) (GH-143792) Add a note to the readline module documentation stating that Python 3.13 and later no longer supports readline in the default REPL, as per gh-118840. Includes workaround using PYTHON_BASIC_REPL. Update tutorial to remove the reference, and use a different key to test things out. (cherry picked from commit 971f387bbb598a481aa8974ddc7a358459030415) Signed-off-by: Kuang Yu Heng <[email protected]> Co-authored-by: Kuang Yu Heng <[email protected]> files: M Doc/library/readline.rst M Doc/tutorial/interpreter.rst diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index f297bdeec913a6..17db0dbdfb4a0e 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -372,3 +372,9 @@ support history save/restore. :: def save_history(self, histfile): readline.set_history_length(1000) readline.write_history_file(histfile) + +.. note:: + + The new :term:`REPL` introduced in version 3.13 doesn't support readline. + However, readline can still be used by setting the :envvar:`PYTHON_BASIC_REPL` + environment variable. diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst index 299b6c2777adc0..09b18786ddbd9c 100644 --- a/Doc/tutorial/interpreter.rst +++ b/Doc/tutorial/interpreter.rst @@ -34,13 +34,13 @@ status. If that doesn't work, you can exit the interpreter by typing the following command: ``quit()``. The interpreter's line-editing features include interactive editing, history -substitution and code completion on systems that support the `GNU Readline -<https://tiswww.case.edu/php/chet/readline/rltop.html>`_ library. +substitution and code completion on most systems. Perhaps the quickest check to see whether command line editing is supported is -typing :kbd:`Control-P` to the first Python prompt you get. If it beeps, you -have command line editing; see Appendix :ref:`tut-interacting` for an -introduction to the keys. If nothing appears to happen, or if ``^P`` is -echoed, command line editing isn't available; you'll only be able to use +typing a word in on the Python prompt, then pressing Left arrow (or :kbd:`Control-b`). +If the cursor moves, you have command line editing; see Appendix +:ref:`tut-interacting` for an introduction to the keys. +If nothing appears to happen, or if a sequence like ``^[[D`` or ``^B`` appears, +command line editing isn't available; you'll only be able to use backspace to remove characters from the current line. The interpreter operates somewhat like the Unix shell: when called with standard _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
