Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling MemoryError in readline.set_completer_delims #69390

Closed
serhiy-storchaka opened this issue Sep 21, 2015 · 2 comments
Closed
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 25203
Nosy @Yhg1s, @serhiy-storchaka
Files
  • readline_set_completer_delims.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2015-09-27.19:57:00.676>
    created_at = <Date 2015-09-21.16:30:46.965>
    labels = ['extension-modules', 'type-bug']
    title = 'Incorrect handling MemoryError in readline.set_completer_delims'
    updated_at = <Date 2015-09-27.19:57:00.495>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-09-27.19:57:00.495>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-09-27.19:57:00.676>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2015-09-21.16:30:46.965>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['40535']
    hgrepos = []
    issue_num = 25203
    keywords = ['patch']
    message_count = 2.0
    messages = ['251239', '251719']
    nosy_count = 3.0
    nosy_names = ['twouters', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25203'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @serhiy-storchaka serhiy-storchaka added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Sep 21, 2015
    @serhiy-storchaka serhiy-storchaka self-assigned this Sep 27, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 27, 2015

    New changeset 46aaff5e8945 by Serhiy Storchaka in branch '3.4':
    Issue bpo-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 bpo-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 bpo-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 bpo-25203: Failed readline.set_completer_delims() no longer left the
    https://hg.python.org/cpython/rev/48943533965e

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant