cpython icon indicating copy to clipboard operation
cpython copied to clipboard

[Windows] New REPL does not preserve history between sessions

Open pfmoore opened this issue 1 year ago • 6 comments
trafficstars

Bug report

Bug description:

I have downloaded Python 3.13.0, Windows 64 bit version from python.org. I have done nothing to customise it.

I start Python. type "12" at the REPL, and press enter. The value 12 is displayed. I hit Ctrl-Z to exit (same happens if I type "exit"). I restart Python and hit the up arrow key. It does not retrieve the "12" from my previous session.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

pfmoore avatar Oct 08 '24 20:10 pfmoore

I was unable to reproduce this problem on Fedora. This might be Windows-specific.

hroncok avatar Oct 08 '24 20:10 hroncok

This is a (supposedly) known limitation, as history support in Windows hasn't been added so far. I took a stab at it in #122274.

devdanzin avatar Oct 08 '24 21:10 devdanzin

:-(

That's something that should probably be publicised much better, then, as it's a surprising and (in my case at least) frustrating limitation compared to the old OS-provided REPL. I'm not sure it's bad enough that I'd switch off the new REPL, but it will take some getting used to.

pfmoore avatar Oct 08 '24 21:10 pfmoore

Sounds like https://github.com/python/cpython/issues/121245 reappears. Does this build has readline support?

skirpichev avatar Oct 09 '24 04:10 skirpichev

Sounds like https://github.com/python/cpython/issues/121245 reappears. Does this build has readline support?

Windows has no readline module.

vstinner avatar Oct 09 '24 08:10 vstinner

In previous versions of python3, installing pyreadline3 added readline support to Windows, which enabled REPL history between sessions. This does not work in python 3.13.

jmw182 avatar Oct 23 '24 20:10 jmw182

This issue is a duplicate of https://github.com/python/cpython/issues/122273 which was fixed by https://github.com/python/cpython/commit/3c7a90a83146dc6e55f6f9ecd9af0bf9682f98a6.

vstinner avatar Nov 28 '24 14:11 vstinner