This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients 0xl3vi, serhiy.storchaka
Date 2017-03-10.08:10:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489133424.79.0.6086605998.issue29779@psf.upfronthosting.co.za>
In-reply-to
Content
$HISTFILE is the name of the file in which Bash command history is saved. Shouldn't the name of similar environment variable for Python be PYTHONHISTFILE?

Bash uses several environment variables for control its command history: HISTCONTROL, HISTFILE, HISTFILESIZE, HISTIGNORE, HISTSIZE, HISTTIMEFORMAT. Does Python need corresponding environment variables?

Wouldn't be better to control all these details by Python code in .pythonrc.py rather than by environment variables? For example I have the following code in my .pythonrc.py:

if sys.version_info < (3,):
    try:
        import readline, os, atexit
        histfile = os.path.join(os.path.expanduser("~"), ".python2_history")
        try:
            readline.read_history_file(histfile)
        except IOError:
            pass
        atexit.register(readline.write_history_file, histfile)
        del os, histfile
    except ImportError:
        pass
History
Date User Action Args
2017-03-10 08:10:24serhiy.storchakasetrecipients: + serhiy.storchaka, 0xl3vi
2017-03-10 08:10:24serhiy.storchakasetmessageid: <1489133424.79.0.6086605998.issue29779@psf.upfronthosting.co.za>
2017-03-10 08:10:24serhiy.storchakalinkissue29779 messages
2017-03-10 08:10:24serhiy.storchakacreate