[issue18323] 'GzipFile' object has no attribute 'extrastart'

Laurent Gautier report at bugs.python.org
Fri Jun 28 13:26:57 CEST 2013


New submission from Laurent Gautier:

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)

----------
components: Library (Lib)
messages: 191989
nosy: Laurent.Gautier
priority: normal
severity: normal
status: open
title: 'GzipFile' object has no attribute 'extrastart'
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18323>
_______________________________________


More information about the Python-bugs-list mailing list