[issue7610] Cannot use both read and readline method in same ZipExtFile object

Nir Aides report at bugs.python.org
Sun Jan 3 11:34:07 CET 2010


Nir Aides <nir at winpdb.org> added the comment:

I uploaded a possible patch for Python 2.7.

The patch converts ZipExtFile into subclass of io.BufferedIOBase and drops most of the original implementation.

However, the patch breaks current newline behavior of ZipExtFile. I figured this was reasonable because zipfile newline behavior:
a) was introduced in Python 2.6
b) was incompatible with behavior of io module files.
c) was not documented.

Reading zip content as text with newline functionality may be done with io.TextIOWrapper.

A bonus of sub classing io.BufferedIOBase is significantly better read performance.

----------
keywords: +patch
Added file: http://bugs.python.org/file15723/zipfile_7610_py27.diff

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


More information about the Python-bugs-list mailing list