gh-73965: New environment variable PYTHON_HISTORY#13208
Conversation
It can be used to set the location of a .python_history file. Co-Authored-By: Levi Sabah <0xl3vi@gmail.com>
| can be set to the callable of your debugger of choice. | ||
| .IP PYTHONHISTORY | ||
| This environment variable can be used to set the location of a history file | ||
| (it is \fI~/.python_history\fP by default). |
There was a problem hiding this comment.
Please, add the windows default as well.
There was a problem hiding this comment.
To be frank, I'm not sure if the Windows default should be mentioned in the man page...
There was a problem hiding this comment.
There is nothing wrong with mentioning Windows ops in man pages.
|
There are few other places in Docs where hardcoded value of |
|
@tirkarthi The first three cases mention The fourth case mentions |
|
By the way, on Windows, |
tiran
left a comment
There was a problem hiding this comment.
The new env var does not obey the sys.flags.ignore_environment flag. Please add a test that the new env var is ignored with -E or -I mode.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Could you please reword to explain what the history file actually does? It's non-obvious to users that are not familiar with readline module internals. |
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @tiran: please review the changes made to this pull request. |
Reword what? |
|
Can this be merged? It seems fairly obvious what |
|
Thanks for this! Please make sure there will be no problem with paths with subdirectories that might not be created. E.g. |
|
Any way to help get this through? It looks like it's been ready for a while. |
|
Looks like there are conflicts now which need to be resolved, and probably rebased. |
|
Guys, why on earth are you I was sincerely expecting to find an internal built-in variable named something like While at the same time being met with: readline.write_history_file.__doc__
# 'Save a readline history file. The default filename is ~/.history.' |
This comment was marked as abuse.
This comment was marked as abuse.
hugovk
left a comment
There was a problem hiding this comment.
Please resolve the merge conflicts.
|
I've resolved conflicts, renamed to |
|
Thanks Hugo! |
| "PYTHON_COLORS : If this variable is set to 1, the interpreter will" | ||
| " colorize various kinds of output. Setting it to 0 deactivates this behavior.\n" | ||
| "These variables have equivalent command-line parameters (see --help for details):\n" | ||
| "PYTHON_HISTORY: the location of a .python_history file.\n" |
There was a problem hiding this comment.
What command line parameter sets it?
There was a problem hiding this comment.
It doesn't have one, I compared with PYTHON_COLORS which doesn't either (#112732). Should we add one?
There was a problem hiding this comment.
If it doesn't have one, then it is in the wrong section.
There was a problem hiding this comment.
Good point, please see PR #113798 to move it to the correct section.
It can be used to set the location of a .python_history file --------- Co-authored-by: Levi Sabah <0xl3vi@gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
It can be used to set the location of a .python_history file --------- Co-authored-by: Levi Sabah <0xl3vi@gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
It can be used to set the location of a .python_history file --------- Co-authored-by: Levi Sabah <0xl3vi@gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
thanks to https://unix.stackexchange.com/questions/630642/change-location-of-python-history - don't use a new folder cause 1) no need for just 1 file 2) python won't make it for you, will just fail to write history. [`xdg-ninja`](https://github.com/b3nj5m1n/xdg-ninja) is good, we need more all-in-one places for doing config like this. but it's more or less just a community thing will need a place for these lines in zshrc /shrug + try some LSP servers + bat hard-wraps, less -S is nice
thanks to https://unix.stackexchange.com/questions/630642/change-location-of-python-history - don't use a new folder cause 1) no need for just 1 file 2) python won't make it for you, will just fail to write history. [`xdg-ninja`](https://github.com/b3nj5m1n/xdg-ninja) is good, we need more all-in-one places for doing config like this. but it's more or less just a community thing will need a place for these lines in zshrc /shrug + try some LSP servers + bat hard-wraps, less -S is nice
It can be used to set the location of a .python_history file.
Co-Authored-By: Levi Sabah 0xl3vi@gmail.com