This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abacabadabacaba
Recipients abacabadabacaba, docs@python
Date 2016-10-14.16:53:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476464022.39.0.651124050997.issue28445@psf.upfronthosting.co.za>
In-reply-to
Content
From the documentation for GzipFile.peek():

    At most one single read on the compressed stream is done to satisfy the call.

If "compressed stream" means the underlying file object, then this is not true. The method tries to return at least one byte, unless the stream is at EOF. It is possible to create arbitrarily long compressed stream that would decompress to nothing, and the implementation would read the entire stream in this case. Because the length of the stream is not known in advance, several reads may be required for this.

Perhaps the documentation for GzipFile.peek() should be made the same as that for BZ2File.peek() and LZMAFile.peek().
History
Date User Action Args
2016-10-14 16:53:42abacabadabacabasetrecipients: + abacabadabacaba, docs@python
2016-10-14 16:53:42abacabadabacabasetmessageid: <1476464022.39.0.651124050997.issue28445@psf.upfronthosting.co.za>
2016-10-14 16:53:42abacabadabacabalinkissue28445 messages
2016-10-14 16:53:42abacabadabacabacreate