classification
Title: Typo in gzip._PaddedFile
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Claudiu.Popa, ned.deily, python-dev
Priority: normal Keywords: patch

Created on 2014-03-09 19:40 by Claudiu.Popa, last changed 2014-03-09 21:49 by ned.deily. This issue is now closed.

Files
File name Uploaded Description Edit
gzip_typo.patch Claudiu.Popa, 2014-03-09 19:41 review
Messages (4)
msg212978 - (view) Author: Claudiu Popa (Claudiu.Popa) * Date: 2014-03-09 19:40
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
>>>
msg212979 - (view) Author: Claudiu Popa (Claudiu.Popa) * Date: 2014-03-09 19:41
Patch attached.
msg212989 - (view) Author: Roundup Robot (python-dev) Date: 2014-03-09 21:48
New changeset c3836de644e0 by Ned Deily in branch '3.3':
Issue #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 #20875: Merge from 3.3
http://hg.python.org/cpython/rev/42599de6a4de
msg212990 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-03-09 21:49
Thanks for the patch!  Committed for release with 3.3.6 and 3.4.1.
History
Date User Action Args
2014-03-09 21:49:51ned.deilysetstatus: open -> closed

versions: + Python 3.3
nosy: + ned.deily

messages: + msg212990
resolution: fixed
stage: resolved
2014-03-09 21:48:31python-devsetnosy: + python-dev
messages: + msg212989
2014-03-09 19:41:44Claudiu.Popasetfiles: + gzip_typo.patch
keywords: + patch
messages: + msg212979
2014-03-09 19:40:15Claudiu.Popacreate