-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-88405: Use platform defined data directories instead of ~/.python_history #26377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
How can I ask for review? I'm not sure whom to notify. |
Alright |
.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
dc505f9
Compare
Changed to |
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 |
Any updates on this? Btw, please let MacOS users also set |
Any chance for this to move forward? |
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.
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/history
or~/.local/state/python/history
;otherwise, fallback to
~/.python_history
.Also if
~/.python_history
exists and is readable, it will always be used for compatibility.https://bugs.python.org/issue44239