[Python-checkins] cpython (merge 3.5 -> default): #25991: merge with 3.5.
ezio.melotti
python-checkins at python.org
Mon Jan 11 16:31:52 EST 2016
https://hg.python.org/cpython/rev/cb08e5271cc0
changeset: 99862:cb08e5271cc0
parent: 99859:6ab135134013
parent: 99861:416db1a2fb81
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Mon Jan 11 23:31:38 2016 +0200
summary:
#25991: merge with 3.5.
files:
Doc/library/readline.rst | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst
--- a/Doc/library/readline.rst
+++ b/Doc/library/readline.rst
@@ -209,6 +209,8 @@
histfile = os.path.join(os.path.expanduser("~"), ".python_history")
try:
readline.read_history_file(histfile)
+ # default history len is -1 (infinite), which may grow unruly
+ readline.set_history_length(1000)
except FileNotFoundError:
pass
@@ -234,6 +236,7 @@
def save(prev_h_len, histfile):
new_h_len = readline.get_history_length()
+ readline.set_history_length(1000)
readline.append_history_file(new_h_len - prev_h_len, histfile)
atexit.register(save, h_len, histfile)
@@ -261,4 +264,5 @@
atexit.register(self.save_history, histfile)
def save_history(self, histfile):
+ readline.set_history_length(1000)
readline.write_history_file(histfile)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list