GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-29779: new environment variable PYTHONHISTORY. · Pull Request #473 · python/cpython Conversation
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
warsaw
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM, with one very minor style nit.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor style nit: You don't need this extra blank line.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ned-deily
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Environment variables are also documented in the Python Setup and Usage document (https://docs.python.org/3/using/cmdline.html#environment-variables) which is generated from Doc/using/cmdline.rst.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
warsaw
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a couple of other thoughts on the implementation and NEWS file entry.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also do something like: return os.environ.get( 'PYTHONHISTORY', os.path.expanduser(os.path.join('~', '.python_history'))) Also
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ned-deily
approved these changes
|
There was an error while loading. Please reload this page.
|
@warsaw all done, I changed set_history_file() to gethistoryfile(). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@0xl3vi We still need a test. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh and yay for Misc/NEWS conflicts. :( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Also note this report which I can confirm. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@warsaw sorry for the dealy. regarding this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@0xl3vi At the very least, I think a test covering The bug happens when the file pointed to by |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
this patch adds new environment variable PYTHONHISTORY, with this you can change the location of a python_history file, without using readline hook in PYTHONSTARTUP. In case PYTHONHISTORY will be empty or not set, it wil fall back to the default history file.
There was an error while loading. Please reload this page.
|
@warsaw OK updated.
The test checks if gethistoryfile() reads the variable. what do you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be documented in Doc/whatsnew/3.7.rst (and please add "(Contributed by Your Name.)")
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| .. envvar:: PYTHONHISTORY | ||
|
|
||
| If set to a non-empty string, you can change the location of a python_history | ||
| file, by default it will be in ~/.python_history. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
``~/.python_history``
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| .. envvar:: PYTHONHISTORY | ||
|
|
||
| If set to a non-empty string, you can change the location of a python_history |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"a ``.python_history`` file" or just "a history file".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if not use the default ~/.python_history file. | ||
| """ | ||
| h = os.environ.get("PYTHONHISTORY") | ||
| if h != '': |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What if os.environ.get("PYTHONHISTORY") returns None?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assertEqual(dirs[1], wanted) | ||
|
|
||
| def test_gethistoryfile(self): | ||
| os.environ['PYTHONHISTORY'] = "xoxo" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please use EnvironmentVarGuard in test.support to set env variables.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ----------------- | ||
|
|
||
| - bpo-29779: New environment variable PYTHONHISTORY if | ||
| this is set you can change the location of a python_history file. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please add "Patch by Your Name."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| the value 0 will disable hash randomization. | ||
| .IP PYTHONHISTORY | ||
| If this is set you can change the location of a | ||
| python_history file, by default it will be ~/.python_history. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
File names should be italic in man pages so \fI~/.python_history\fI or
python_history file, by default it will be .IR ~/.python_history .
You may need to escape ~ or / characters.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| " on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" | ||
| " hooks.\n"; | ||
| " hooks.\n" | ||
| "PYTHONHISTORY: If this is set, you can change the location of a python_history file.\n"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This line is a bit long.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
OK, I don't have time to do it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@0xl3vi Hi. I'm sorry this has taken so long. Are you saying in your comment that you don't have time to finish this branch? If so, that's okay and we greatly appreciate your contribution so far. I'm willing to finish this branch for you if you'd like. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@warsaw sure if you want. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@warsaw @berkerpeksag I have created a new PR for this feature: GH-13208. It addresses all of @berkerpeksag's comments. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.1.0 to 1.3.1. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-python@1.1.0...1.3.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.