changeset: 79380:7252f9f95fe6 branch: 3.3 user: Nadeem Vawda date: Mon Oct 01 23:04:11 2012 +0200 files: Lib/bz2.py description: Fix error handling in new fast path of BZ2File.readline(). diff -r e6d872b61c57 -r 7252f9f95fe6 Lib/bz2.py --- a/Lib/bz2.py Mon Oct 01 23:02:50 2012 +0200 +++ b/Lib/bz2.py Mon Oct 01 23:04:11 2012 +0200 @@ -323,6 +323,7 @@ raise TypeError("Integer argument expected") size = size.__index__() with self._lock: + self._check_can_read() # Shortcut for the common case - the whole line is in the buffer. if size < 0: end = self._buffer.find(b"\n", self._buffer_offset) + 1