From: Nadeem Vawda Date: Mon, 1 Oct 2012 21:04:11 +0000 (+0200) Subject: Fix error handling in new fast path of BZ2File.readline(). X-Git-Tag: v3.3.1rc1~815^2~58^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=138ad5066d5e523eb81cabd4a05ed51d6664210d;p=python Fix error handling in new fast path of BZ2File.readline(). --- diff --git a/Lib/bz2.py b/Lib/bz2.py index 87bed214d0..da19e27233 100644 --- a/Lib/bz2.py +++ b/Lib/bz2.py @@ -323,6 +323,7 @@ class BZ2File(io.BufferedIOBase): 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