gh-88405: Use platform defined data directories instead of ~/.python_history#26377
gh-88405: Use platform defined data directories instead of ~/.python_history#26377oxalica wants to merge 4 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
How can I ask for review? I'm not sure whom to notify. |
Sorry, something went wrong.
Alright |
Sorry, something went wrong.
|
.python_history probably belongs under $XDG_STATE_HOME on linux rather than $XDG_DATA_HOME
Then again just getting it out of user root would be nice. |
Sorry, something went wrong.
f4758ed to
dc505f9
Compare
September 24, 2021 18:42
|
Changed to |
Sorry, something went wrong.
|
Instead of you hard-coding a commonly used and often changed file-path like this, please consider using an internal built-in variable named something like mentioned #13208 |
Sorry, something went wrong.
|
Any updates on this? Btw, please let MacOS users also set |
Sorry, something went wrong.
|
Any chance for this to move forward? |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
Currently we use path
~/.python_historyfor history file in all platforms.It is not a good choice since it spams in user's home directory.
This patch use platform defined directories for put the history file.
For Windows, it's
%APPDATA%/Python/history;for Mac OS, it's
~/Library/Application Support/Python/history;for other POSIX platforms, it's
$XDG_STATE_HOME/python/historyor~/.local/state/python/history;otherwise, fallback to
~/.python_history.Also if
~/.python_historyexists and is readable, it will always be used for compatibility.https://bugs.python.org/issue44239