Martin Panter added the comment: Wolfgang: If the patch here is too massive, perhaps you might like to review my patch at Issue 23528 first. :) It only fixes the “gzip” module, but is definitely simpler, so might have more chance of making it into 3.4 or 3.5 on time.
=== Changes introduced by patch v7 if anyone’s interested: <https://bitbucket.org/vadmium/cpython/commits/b7c43f7>. A few problems and behaviour changes are introduced: * GzipFile(filename=...).close() now relies on the garbage collector to close the file * EOFError("Compressed file ended before the end-of-stream marker was reached") repaced with “struct.error” exception in some cases, e.g. GzipFile(fileobj=BytesIO(gzip_data[:3])).read() * Premature EOF when stream ends in some cases, e.g. GzipFile(fileobj=BytesIO(empty_gzip + gzip_data)).read() However I think the general idea of inheriting the common reader class and overriding as necessary is sound. Just looks like the code got too messed around in the process. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23529> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com