Nadeem Vawda <nadeem.va...@gmail.com> added the comment: > Something looks fishy: what happens if size is -1 and EOFError is not raised?
You're right - I missed that possibility. In that case, extrasize and offset get updated incorrectly, which will break subsequent calls to seek() and tell(). However, it seems that subsequent reads work fine, because slicing a bytes object with a too-large upper bound doesn't raise an exception. The attached patch fixes this bug, and updates test_read1() to catch regressions. ---------- Added file: http://bugs.python.org/file21532/gzipfile_read1.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10791> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com