[issue25991] readline example eventually consumes all memory

2016-01-11 Thread Martin Panter

Martin Panter added the comment:

Thanks Ezio for handling this. Ignore my previous comment; I missed the key 
word “example” :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25991] readline example eventually consumes all memory

2016-01-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9a2c891a4333 by Ezio Melotti in branch '2.7':
#25991: fix readline example to limit history size.  Patch by Daniel Dye.
https://hg.python.org/cpython/rev/9a2c891a4333

New changeset 416db1a2fb81 by Ezio Melotti in branch '3.5':
#25991: fix readline example to limit history size.  Patch by Daniel Dye.
https://hg.python.org/cpython/rev/416db1a2fb81

New changeset cb08e5271cc0 by Ezio Melotti in branch 'default':
#25991: merge with 3.5.
https://hg.python.org/cpython/rev/cb08e5271cc0

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25991] readline example eventually consumes all memory

2016-01-11 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25991] readline example eventually consumes all memory

2016-01-08 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti
stage:  -> needs patch
type: resource usage -> enhancement
versions: +Python 2.7, Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25991] readline example eventually consumes all memory

2016-01-08 Thread Martin Panter

Martin Panter added the comment:

What version of Readline are you using? Is it perhaps Editline (libedit)? When 
I experimented with Editline on Linux once, I think I saw the history file 
doubling in size every time I ran Python. Maybe that is what you are seeing.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25991] readline example eventually consumes all memory

2016-01-01 Thread Bruce Frederiksen

New submission from Bruce Frederiksen:

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.

--
assignee: docs@python
components: Documentation
messages: 257325
nosy: dangyogi, docs@python
priority: normal
severity: normal
status: open
title: readline example eventually consumes all memory
type: resource usage
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com