This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Strange readline save history behaviour in site.py
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: doraeric
Priority: normal Keywords:

Created on 2021-10-27 17:24 by doraeric, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg405114 - (view) Author: doraeric (doraeric) Date: 2021-10-27 17:24
I noticed that in site.py, it saves history to a hard-coded location if the current history length is 0. The history is considered as not loaded if the length is 0, but it may be actually loaded from a empty file. In this case, the history is save to hard-coded ~/.python_history, and maybe another user-defined location in PYTHONSTARTUP file.

I think a better solution is to export some config or functions from site.py, so users can explicitly disable the atexit callback from site.py.

---
[site.py] https://github.com/python/cpython/blob/b9cdd0fb9c463c2503a4d854bb6529a9db58fe1b/Lib/site.py#L470-L491
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89795
2021-10-27 17:24:21doraericcreate