Serhiy Storchaka added the comment: Because it is unspecified in io.BufferedReader.peek() and in many classes implemented the io.BufferedReader interface.
.. method:: peek([size]) Return bytes from the stream without advancing the position. At most one single read on the raw stream is done to satisfy the call. The number of bytes returned may be less or more than requested. I agree that this is weird, but this is a much larger issue than just bz2. We can't just "fix" this for bz2. This worths a discussion on Python-Dev. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20856> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com