Open
Description
Bug report
Bug description:
In my ~/.pystartup I have the following code:
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(historyPath=historyPath):
import readline
readline.write_history_file(historyPath)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
This is something I've been using for years. With this startup file, I can enter the REPL and immediately up-arrow to scroll through the commands I used the last time I used the REPL.
With the new REPL there are two related things going wrong:
- my command history is not loaded (when I immediately up-arrow, it does nothing)
- my command history is not saved in my .pyhistory file (the file is touched but not otherwise modified)
CC @ambv, @pablogsal
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux