Serhiy Storchaka added the comment:

At the moment gzip can raise two errors on unexpected EOF: struct.error from 
struct.unpack() or TypeError from ord(). Both bz2 and lzma raise EOFError in 
such cases.

The proposed patch converts both truncated gzip errors to EOFError as for bz2 
and lzma. Added similar tests for gzip, bz2 and lzma.

I doubt about backward compatibility. It's obvious that struct.error and 
TypeError are unintentional, and EOFError is purposed for this case. However 
users can catch undocumented but de facto exceptions and doesn't expect 
EOFError.

----------
nosy: +nadeem.vawda
stage: needs patch -> patch review
versions: +Python 3.3, Python 3.4 -Python 3.1
Added file: http://bugs.python.org/file28727/gzip_eof-3.4.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1159051>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to