-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When using new REPL in Python 13, the readline module does not write history to the files correctly.
I have checked this issue on both my host system, as well as python:alpine container from docker.
Using PYTHON_BASIC_REPL=1 no longer causes this issue.
Expected
hist.txt file contains the saved commands.
Actual
hist.txt file is empty. Note that .python_history file does save and load history correctly.
/ # python -i
Python 3.13.2 (main, Feb 14 2025, 19:28:41) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> print('abc')
abc
>>> readline.get_current_history_length()
0
>>> readline.set_history_length(100)
>>> readline.get_current_history_length()
0
>>> readline.write_history_file('hist.txt')
>>>
/ # cat hist.txt
/ # cat ~/.python_history
import readline
print('abc')
readline.get_current_history_length()
readline.set_history_length(100)
readline.get_current_history_length()
readline.write_history_file('hist.txt')
/ #
CPython versions tested on:
3.13
Operating systems tested on:
Linux
paulclarkaranz and kingkong-cmd
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error