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

Typo in gzip._PaddedFile #65074

Closed
PCManticore mannequin opened this issue Mar 9, 2014 · 4 comments
Closed

Typo in gzip._PaddedFile #65074

PCManticore mannequin opened this issue Mar 9, 2014 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@PCManticore
Copy link
Mannequin

PCManticore mannequin commented Mar 9, 2014

BPO 20875
Nosy @ned-deily, @PCManticore
Files
  • gzip_typo.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 = None
    closed_at = <Date 2014-03-09.21:49:51.849>
    created_at = <Date 2014-03-09.19:40:15.544>
    labels = ['type-bug', 'library']
    title = 'Typo in gzip._PaddedFile'
    updated_at = <Date 2014-03-09.21:49:51.822>
    user = 'https://github.com/PCManticore'

    bugs.python.org fields:

    activity = <Date 2014-03-09.21:49:51.822>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-03-09.21:49:51.849>
    closer = 'ned.deily'
    components = ['Library (Lib)']
    creation = <Date 2014-03-09.19:40:15.544>
    creator = 'Claudiu.Popa'
    dependencies = []
    files = ['34312']
    hgrepos = []
    issue_num = 20875
    keywords = ['patch']
    message_count = 4.0
    messages = ['212978', '212979', '212989', '212990']
    nosy_count = 3.0
    nosy_names = ['ned.deily', 'Claudiu.Popa', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20875'
    versions = ['Python 3.3', 'Python 3.4']

    @PCManticore
    Copy link
    Mannequin Author

    PCManticore mannequin commented Mar 9, 2014

    There's a typo in gzip._PaddedFile.prepend. Here's a snippet to reproduce it.

    >>> import gzip
    >>> x=gzip.open("a.gz")
    >>> x.fileobj.prepend()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/tank/libs/cpython/Lib/gzip.py", line 99, in prepend
        self._buffer = self._buffer[read:] + prepend
    NameError: name 'read' is not defined
    >>>

    @PCManticore PCManticore mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Mar 9, 2014
    @PCManticore
    Copy link
    Mannequin Author

    PCManticore mannequin commented Mar 9, 2014

    Patch attached.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 9, 2014

    New changeset c3836de644e0 by Ned Deily in branch '3.3':
    Issue bpo-20875: Prevent possible gzip "'read' is not defined" NameError.
    http://hg.python.org/cpython/rev/c3836de644e0

    New changeset 42599de6a4de by Ned Deily in branch 'default':
    Issue bpo-20875: Merge from 3.3
    http://hg.python.org/cpython/rev/42599de6a4de

    @ned-deily
    Copy link
    Member

    Thanks for the patch! Committed for release with 3.3.6 and 3.4.1.

    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant