[New-bugs-announce] [issue44239] Use platform defined data directories instead of ~/.python_history

oxalica report at bugs.python.org
Wed May 26 06:58:43 EDT 2021


New submission from oxalica <oxalicc at pm.me>:

Currently we use path `~/.python_history` for history file in all platforms.
It is not a good choice since it spams in user's home directory.

There are already specifications for where to store program data.
For Windows, we should use `%APPDATA%/Python/history`;
for Mac OS, we should use `~/Library/Application Support/Python/history`;
for other POSIX platforms, we should use `$XDG_DATA_HOME/python/history` or `~/.local/share/python/history` according to XDG Spec.

These paths should be preferred as default. But we can also check and use `~/.python_history` if it exists and readable, for compatibility.

----------
components: Library (Lib)
messages: 394429
nosy: oxalica
priority: normal
severity: normal
status: open
title: Use platform defined data directories instead of ~/.python_history
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44239>
_______________________________________


More information about the New-bugs-announce mailing list