[issue20886] Disabling logging to ~/.python_history is not simple enough

Sworddragon report at bugs.python.org
Mon Mar 10 21:30:35 CET 2014


New submission from Sworddragon:

I have noticed that since Python 3.4 the interactive mode does log all commands to ~/.python_history. This caused me to switch into "normal user mode" and look for a solution. With Google I have found the related entry in the documentation:

On systems that support readline, this module will also import and configure the rlcompleter module, if Python is started in interactive mode and without the -S option. The default behavior is enable tab-completion and to use ~/.python_history as the history save file. To disable it, delete (or override) the sys.__interactivehook__ attribute in your sitecustomize or usercustomize module or your PYTHONSTARTUP file.


On my system PYTHONSTARTUP is empty and if I would still pretending that I would be a normal user I would now get in panic. I think either the documentation needs an enhancement or disabling logging should be more simplified. For example the shell controls this with the HISTFILESIZE environment variable. Maybe Python can use for this case an environment variable too that the user can store in his ~/.bashrc.

----------
components: Library (Lib)
messages: 213079
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Disabling logging to ~/.python_history is not simple enough
type: enhancement
versions: Python 3.4

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


More information about the Python-bugs-list mailing list