-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GzipFile doesn't have peek() #54171
Comments
GzipFile claims to implement BufferedIOBase but doesn't have peek(). |
Here is a first patch, tests still need to be written. |
Same patch with tests. |
Committed in r85100. |
Hi Antoine, BufferedIOBase is not documented to have peek(): Small note about patch:
|
Hir Nir,
Ah, you're right.
Indeed.
Actually, I think I should have reproduced the algorithm in read(), Thanks for the review, it looks like I should have waited a bit before |
Here is a patch fixing these issues. |
Should be min(n, 1024) instead of max(...) |
Well, no, because we want to buffer a non-trivial amount of bytes for |
Right, I missed the change from self.max_read_chunk to 1024 (read_size). Should not peek() limit to self.max_read_chunk as read() does? |
This is used for the chunking of huge reads, but for peek():
|
I've committed the improvements in r85221. Thank you! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: