[issue28445] Wrong documentation for GzipFile.peek

2021-11-28 Thread jiahua wang
Change by jiahua wang : -- keywords: +patch nosy: +180909 nosy_count: 4.0 -> 5.0 pull_requests: +28052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29820 ___ Python tracker ___

[issue28445] Wrong documentation for GzipFile.peek

2021-11-19 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy, newcomer friendly type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5 ___ Python tracker ___ ___

[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Martin Panter
Martin Panter added the comment: The peek() method was originally added by Issue 9962, where Antoine was trying to imitate the BufferedReader.peek() API. However because “the number of bytes returned may be more or less than requested”, I never understood what this methods were good for; see a

[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Xiang Zhang
Xiang Zhang added the comment: The "compressed stream" is not the underlying file object but _GzipReader. And actually the "at most one single reader" is the characteristic of io.BufferedReader.peek, you can see it in the doc. Maybe it needs multiple reads on the file object in a single peek,

[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +martin.panter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Evgeny Kapun
New submission from Evgeny Kapun: >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