[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

Madison May report at bugs.python.org
Thu Jul 11 22:09:52 CEST 2013


Madison May added the comment:

Why would something like the following work?

#At the beginning of peek()
#keep track of prior offset
position = self.fileobj.tell()

#immediately before return statement
#restore previous fileobj offset
self.fileobj.seek(position)

----------
nosy: +madison.may

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18430>
_______________________________________


More information about the Python-bugs-list mailing list