-
-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.13.0b3 REPL empties ~/.python_history #121245
Comments
This is always reproducible: $ python3.12
Python 3.12.3 (main, Apr 17 2024, 00:00:00) [GCC 13.2.1 20240316 (Red Hat 13.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 'Save this'
'Save this'
>>> ^D
$ cat ~/.python_history
'Save this'
$ python3.13
Python 3.13.0b3 (main, Jun 28 2024, 00:00:00) [GCC 13.3.1 20240522 (Red Hat 13.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [arrow up]'Save this'
'Save this'
>>> ^D
$ cat ~/.python_history
(empty)
$ python3.12
Python 3.12.3 (main, Apr 17 2024, 00:00:00) [GCC 13.2.1 20240316 (Red Hat 13.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [arrow up]
(empty) |
|
Moreover, I believe that even if the code in site.py "cannot use pyrepl", it should never ever write empty history. |
This prevents writing incorrect history (empty).
PR is ready: #121255 |
Suggestion: Let's merge #121255 as is but do not close this issue yet. I think there are multiple improvements possible:
|
Yep, I'll work on this in second pr. |
This prevents writing incorrect history (empty). Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* make readline stuff more symmetrical wrt reading/writing * prevent truncation of the history file * add regression test Should finally address python#121245.
* make readline stuff more symmetrical wrt reading/writing * prevent truncation of the history file * add regression test Should finally address python#121245.
Second PR is ready for review: #121259 |
(cherry picked from commit 7a807c3) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
…onGH-121259) (cherry picked from commit afee76b) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
See #121351. @hroncok, I think that means that simple patch from the first PR doesn't fix problem on all systems. Probably we should use my patch 8195067 from #121259. To make it work we can set CAN_USE_REPL before loading the site module, see #121259 (comment) |
Bug report
Bug description:
As discussed in https://discuss.python.org/t/python-3-13-0-beta-3-now-available/56847/7 and #120766 (comment)
When I updated from Python 3.13.0b2 to b3 and started the REPL for the first time, pressing arrow up showed the history.
Upon exiting and starting again, there is no more history when I press arrow up. I noticed it is also missing from my other Python REPLs.
~/.python_history
is empty.To reproduce, I did:
python3.13
python3.13
again -- no historyCPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: