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 dangyogi
Recipients dangyogi, docs@python
Date 2016-01-02.04:28:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451708933.83.0.797303528676.issue25991@psf.upfronthosting.co.za>
In-reply-to
Content
The Example in the readline documentation (section 6.7 of the Library Reference) shows how to save your readline history in a file, and restore it each time you start Python.

The problem with the Example is that it does not include a call to readline.set_history_length and the default is -1 (infinite).

As a Python developer, I start Python quite a lot and had a .python_history file that was 850M bytes.  Just starting Python was causing my system to thrash before the first prompt (>>>) even appeared.

I suggest adding the following line to the example to avoid this:

readline.set_history_length(1000)

I'm not sure how far back this goes in terms of earlier versions of Python, but probably quite far.
History
Date User Action Args
2016-01-02 04:28:53dangyogisetrecipients: + dangyogi, docs@python
2016-01-02 04:28:53dangyogisetmessageid: <1451708933.83.0.797303528676.issue25991@psf.upfronthosting.co.za>
2016-01-02 04:28:53dangyogilinkissue25991 messages
2016-01-02 04:28:52dangyogicreate