[issue29779] New environment variable PYTHONHISTORY

Barry A. Warsaw report at bugs.python.org
Tue Mar 14 18:05:22 EDT 2017


Barry A. Warsaw added the comment:

On Mar 12, 2017, at 11:42 AM, Chi Hsuan Yen wrote:

>That's a great feature! Here's a question: what should be CPython's behavior
>when PYTHONHISTORY is explicitly set to empty? Currently there's an error:
>
>$ PYTHONHISTORY= ./python
>Python 3.7.0a0 (master:f6595983e08fe20cf06a2535d74d912c6dbb044f, Mar 12 2017, 19:22:29) 
>[GCC 6.3.1 20170306] on linux
>Type "help", "copyright", "credits" or "license" for more information.
>>>>   
>Error in atexit._run_exitfuncs:
>FileNotFoundError: [Errno 2] No such file or directory

Yeah, that's not good.  I'll note that in the PR.

(But also note that you have to unset PYTHONSTARTUP if you, like me, use that
as the old school way of enabling history.)

>Maybe it's better to just disable the history functionality in this case?

It should use the default, but it shouldn't cause an error.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29779>
_______________________________________


More information about the Python-bugs-list mailing list