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.

classification
Title: Incorrect handling MemoryError in readline.set_completer_delims
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka, twouters
Priority: normal Keywords: patch

Created on 2015-09-21 16:30 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
readline_set_completer_delims.patch serhiy.storchaka, 2015-09-21 16:30 review
Messages (2)
msg251239 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-21 16:30
MemoryError raised in readline.set_completer_delims() turns the readline library to incorrect state.

$ (ulimit -v 200000; ./python;)
Python 3.6.0a0 (default:e33b4c18af59+, Sep 17 2015, 17:05:17) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> readline.get_completer_delims()
' \t\n`~!@#$%^&*()-=+[{]}\\|;:\'",<>/?'
>>> readline.set_completer_delims(' '*10**8)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError
>>> readline.get_completer_delims()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 1: invalid continuation byte

Proposed patch fixes the issue.
msg251719 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-27 19:39
New changeset 46aaff5e8945 by Serhiy Storchaka in branch '3.4':
Issue #25203: Failed readline.set_completer_delims() no longer left the
https://hg.python.org/cpython/rev/46aaff5e8945

New changeset d867ca794bdb by Serhiy Storchaka in branch '2.7':
Issue #25203: Failed readline.set_completer_delims() no longer left the
https://hg.python.org/cpython/rev/d867ca794bdb

New changeset 0d3b64bbc82c by Serhiy Storchaka in branch '3.5':
Issue #25203: Failed readline.set_completer_delims() no longer left the
https://hg.python.org/cpython/rev/0d3b64bbc82c

New changeset 48943533965e by Serhiy Storchaka in branch 'default':
Issue #25203: Failed readline.set_completer_delims() no longer left the
https://hg.python.org/cpython/rev/48943533965e
History
Date User Action Args
2022-04-11 14:58:21adminsetgithub: 69390
2015-09-27 19:57:00serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-09-27 19:39:53python-devsetnosy: + python-dev
messages: + msg251719
2015-09-27 19:35:12serhiy.storchakasetassignee: serhiy.storchaka
2015-09-21 16:30:46serhiy.storchakacreate