From f94df933b9770ca5bea9b1f622c6967b6f7723d6 Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Sun, 27 Jul 2025 18:12:05 +0800 Subject: [PATCH 1/8] docs: note readline no longer supported in REPL after 3.13 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. Closes gh-137113. Signed-off-by: Kuang Yu Heng --- Doc/library/readline.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index f649fce5efc377..937182806f6ffe 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -7,6 +7,10 @@ .. sectionauthor:: Skip Montanaro +.. note:: + The Python REPL after version 3.13 no longer supports readline as per :gh:`118840`. + However, readline can still be used if the :envvar:`PYTHON_BASIC_REPL` environment variable is set. + -------------- The :mod:`readline` module defines a number of functions to facilitate From a6a14e5c1022226bfbb18f832ab41d146f9e3e5c Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Mon, 28 Jul 2025 22:53:07 +0800 Subject: [PATCH 2/8] doc: rephrased readline support documentation as per feedback Signed-off-by: Kuang Yu Heng --- Doc/library/readline.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 937182806f6ffe..9a2d70f99b76a2 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -8,8 +8,8 @@ .. sectionauthor:: Skip Montanaro .. note:: - The Python REPL after version 3.13 no longer supports readline as per :gh:`118840`. - However, readline can still be used if the :envvar:`PYTHON_BASIC_REPL` environment variable is set. + The new REPL introduced in version 3.13 no longer supports readline. + However, readline can still be used by setting the :envvar:`PYTHON_BASIC_REPL` environment variable. -------------- From c80757374b30e1f95348bdfabe83731cde67d7e6 Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Mon, 28 Jul 2025 23:03:58 +0800 Subject: [PATCH 3/8] docs: rephrased readline support wording Signed-off-by: Kuang Yu Heng --- Doc/library/readline.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 9a2d70f99b76a2..922c7489bd11c0 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -8,7 +8,7 @@ .. sectionauthor:: Skip Montanaro .. note:: - The new REPL introduced in version 3.13 no longer supports readline. + 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. -------------- From b458dbf49f7bbe6d5b0b58b584e72587cf3d344a Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Tue, 29 Jul 2025 21:47:48 +0800 Subject: [PATCH 4/8] reduce line length Co-authored-by: AN Long --- Doc/library/readline.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 922c7489bd11c0..23d5421485a0a6 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -9,7 +9,8 @@ .. 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. + However, readline can still be used by setting the :envvar:`PYTHON_BASIC_REPL` + environment variable. -------------- From 5754eb2762f2269e39dd309babff7cda9b718219 Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Fri, 14 Nov 2025 15:51:54 -0800 Subject: [PATCH 5/8] docs: moved readline no longer supported note to the end of page --- Doc/library/readline.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 9723e3502d3aae..e12b7713981caf 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -7,11 +7,6 @@ .. sectionauthor:: Skip Montanaro -.. 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. - -------------- The :mod:`readline` module defines a number of functions to facilitate @@ -399,3 +394,7 @@ support history save/restore. :: def save_history(self, histfile): readline.set_history_length(1000) readline.write_history_file(histfile) + +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. From 467b4ba8203e9ab9f2abd890537d7c20aa9b15d1 Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Fri, 14 Nov 2025 16:01:24 -0800 Subject: [PATCH 6/8] docs: readded note label to readline docs --- Doc/library/readline.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index e12b7713981caf..f76cd9ecdf2505 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -394,7 +394,8 @@ 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. + 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. From 9dd8c51212b5bf1f71e9e23d25082d591417f803 Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Fri, 14 Nov 2025 22:27:06 -0800 Subject: [PATCH 7/8] docs: bugfix for readline --- Doc/library/readline.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index f76cd9ecdf2505..02e0d100791212 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -394,6 +394,7 @@ 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. From dbeef545fdbe85a6b6411a455ceb0389532a43eb Mon Sep 17 00:00:00 2001 From: Kuang Yu Heng Date: Tue, 18 Nov 2025 00:44:59 -0800 Subject: [PATCH 8/8] docs: removed mention of readline in tutorial as it is deprecated --- Doc/tutorial/interpreter.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst index cd52607142485e..e7b0d039f6e86a 100644 --- a/Doc/tutorial/interpreter.rst +++ b/Doc/tutorial/interpreter.rst @@ -33,16 +33,6 @@ Windows) at the primary prompt causes the interpreter to exit with a zero exit 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 -`_ library. -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 -backspace to remove characters from the current line. - The interpreter operates somewhat like the Unix shell: when called with standard input connected to a tty device, it reads and executes commands interactively; when called with a file name argument or with a file as standard input, it reads