[issue10791] Wrapping TextIOWrapper around gzip files

Antoine Pitrou report at bugs.python.org
Mon Apr 4 00:41:02 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> Nadeem Vawda <nadeem.vawda at gmail.com> added the comment:
> 
> > Is following change in GzipFile class enough:
> > 
> >     def read1(self, n):
> >         return self.read(n)
> > 
> > ? This satisfies TextIOWrapper to run readline correctly.
> 
> Looks good to me.

Well, ideally, read1() should satisfy the condition stated in the
BufferedIOBase documentation - namely, that it issues at most one read()
call on the underlying stream.

----------

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


More information about the Python-bugs-list mailing list