-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Python 3.13.0b3 REPL empties ~/.python_history #121245
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
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 <[email protected]>
Co-authored-by: Miro Hrončok <[email protected]>
Co-authored-by: Miro Hrončok <[email protected]>
* 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 <[email protected]> Co-authored-by: Miro Hrončok <[email protected]>
(cherry picked from commit 7a807c3) Co-authored-by: Sergey B Kirpichev <[email protected]> Co-authored-by: Miro Hrončok <[email protected]>
Co-authored-by: Miro Hrončok <[email protected]>
…onGH-121259) (cherry picked from commit afee76b) Co-authored-by: Sergey B Kirpichev <[email protected]>
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) |
Co-authored-by: Miro Hrončok <[email protected]>
also initialize CAN_USE_PYREPL at import _pyrepl.main
also initialize CAN_USE_PYREPL at import from _pyrepl.main
PR is ready for review: #121659 |
Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit 05d4137) Co-authored-by: Sergey B Kirpichev <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
…21816) (cherry picked from commit 05d4137) Co-authored-by: Sergey B Kirpichev <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
@ambv, probably this also could be closed. |
Co-authored-by: Miro Hrončok <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
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: