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

Excessive optimization in IncrementalNewlineDecoder #49683

Closed
pitrou opened this issue Mar 6, 2009 · 3 comments
Closed

Excessive optimization in IncrementalNewlineDecoder #49683

pitrou opened this issue Mar 6, 2009 · 3 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Mar 6, 2009

BPO 5433
Nosy @pitrou
Files
  • issue5433.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/pitrou'
    closed_at = <Date 2009-03-06.23:41:18.286>
    created_at = <Date 2009-03-06.23:06:41.098>
    labels = ['extension-modules', 'type-bug']
    title = 'Excessive optimization in IncrementalNewlineDecoder'
    updated_at = <Date 2009-03-06.23:41:18.285>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2009-03-06.23:41:18.285>
    actor = 'pitrou'
    assignee = 'pitrou'
    closed = True
    closed_date = <Date 2009-03-06.23:41:18.286>
    closer = 'pitrou'
    components = ['Extension Modules']
    creation = <Date 2009-03-06.23:06:41.098>
    creator = 'pitrou'
    dependencies = []
    files = ['13256']
    hgrepos = []
    issue_num = 5433
    keywords = ['patch']
    message_count = 3.0
    messages = ['83258', '83260', '83261']
    nosy_count = 1.0
    nosy_names = ['pitrou']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5433'
    versions = ['Python 3.1']

    @pitrou
    Copy link
    Member Author

    pitrou commented Mar 6, 2009

    This is with the io-c code:

    >>> dec = io.IncrementalNewlineDecoder(None, translate=False)
    >>> dec.newlines
    >>> dec.decode("\u0A00")
    '\u0a00'
    >>> dec.newlines
    '\n'

    dec.newlines should have remained equal to None. It only affects the
    computation of the newlines property and shouldn't produce incorrect
    decoding results.

    @pitrou pitrou self-assigned this Mar 6, 2009
    @pitrou pitrou added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Mar 6, 2009
    @pitrou
    Copy link
    Member Author

    pitrou commented Mar 6, 2009

    This patch fixes the bug without incurring any significant slowdown.

    @pitrou
    Copy link
    Member Author

    pitrou commented Mar 6, 2009

    Committed in r70208.

    @pitrou pitrou closed this as completed Mar 6, 2009
    @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