[issue41563] .python_history file causes considerable slowdown

Steven D'Aprano report at bugs.python.org
Mon Aug 17 06:26:27 EDT 2020


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> My history file is only 500 lines.

*slaps forehead*

Of course it is, I'm running a customer history hook that has a limit of 500 lines in the history file.

It looks to me that by default the history feature is set to unlimited lines, so I guess that implies that this isn't a bug and it is your responsibility to set a maximum history length.

You can put these two lines in your Python startup file:

    import readline
    readline.set_history_length(1000)  # or any number you like



Personally, I don't think that having a default setting that allows the history file to grow to 130MB is a good idea.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41563>
_______________________________________


More information about the Python-bugs-list mailing list