Uh oh!
There was an error while loading. Please reload this page.
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. |
oxalica
commented
Jun 28, 2021
How can I ask for review? I'm not sure whom to notify. |
Ayushparikh-code
commented
Jun 28, 2021
Alright |
SvartaHjarta
commented
Sep 23, 2021
.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. |
f4758ed to
dc505f9Compareoxalica
commented
Sep 24, 2021
Changed to |
eabase
commented
Jan 24, 2022
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 |
yochem
commented
Jan 11, 2023
Any updates on this? Btw, please let MacOS users also set |
MestreLion
commented
Jun 5, 2023
Any chance for this to move forward? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This PR is stale because it has been open for 30 days with no activity. |
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