New submission from doraeric <benson.dorae...@gmail.com>:

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

----------
components: Library (Lib)
messages: 405114
nosy: doraeric
priority: normal
severity: normal
status: open
title: Strange readline save history behaviour in site.py
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to