Serhiy Storchaka added the comment:

A file can be non-seekable (pipe, socket) and we can't "unread" unused data 
back.

We can't implement GzipFile.peek() in terms of underlied file's peek() because 
peek() doesn't guaranteed return more than one byte, but it should return at 
least one byte if the file is not ended. We can't detect the end of compressed 
data without reading some data past the end of compressed data.

----------

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

Reply via email to