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.

Author Laurent.Gautier
Recipients Laurent.Gautier
Date 2013-06-28.11:26:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372418817.06.0.791452748439.issue18323@psf.upfronthosting.co.za>
In-reply-to
Content
When creating a `gzip.GzipFile` using the named parameter `fileobj`
rather than filename, iterating over it is broken:
```
AttributeError: 'GzipFile' object has no attribute 'extrastart'
```

The short example below is demonstrating the problem:

## ---

import gzip, tempfile
_data = (b'@WXOVW:25:85', b'ATACGCGGCT'+b'GATCGTAGCG',
         b'+',
         b'@@))CCCCBB'+b'???ECCEECC')

data = gzip.zlib.compress(b'\n'.join(_data))
foo = tempfile.NamedTemporaryFile()
foo.write(data)
foo.flush()
foo.seek(0)

gzf = gzip.GzipFile(fileobj=foo)

# this will trigger the AttributeError
for x in gzf:
    print(x)
History
Date User Action Args
2013-06-28 11:26:57Laurent.Gautiersetrecipients: + Laurent.Gautier
2013-06-28 11:26:57Laurent.Gautiersetmessageid: <1372418817.06.0.791452748439.issue18323@psf.upfronthosting.co.za>
2013-06-28 11:26:57Laurent.Gautierlinkissue18323 messages
2013-06-28 11:26:56Laurent.Gautiercreate