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.
Created on 2010年09月27日 21:38 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
Files | ||||
---|---|---|---|---|
File name | Uploaded | Description | Edit | |
gzippeek.patch | pitrou, 2010年09月27日 23:56 | |||
gzippeek2.patch | pitrou, 2010年09月28日 21:35 | review | ||
gzipfixup.patch | pitrou, 2010年09月30日 22:37 |
Messages (12) | |||
---|---|---|---|
msg117476 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月27日 21:38 | |
GzipFile claims to implement BufferedIOBase but doesn't have peek(). |
|||
msg117491 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月27日 23:56 | |
Here is a first patch, tests still need to be written. |
|||
msg117552 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月28日 21:35 | |
Same patch with tests. |
|||
msg117594 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月29日 10:50 | |
Committed in r85100. |
|||
msg117706 - (view) | Author: Nir Aides (nirai) (Python triager) | Date: 2010年09月30日 08:03 | |
Hi Antoine, BufferedIOBase is not documented to have peek(): http://docs.python.org/dev/py3k/library/io.html Small note about patch: 1) IOError string says "read() on write-only...", should be "peek() on write-only..." ? 2) Should be min() in self._read(max(self.max_read_chunk, n)) |
|||
msg117752 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月30日 17:01 | |
Hir Nir, > BufferedIOBase is not documented to have peek(): > http://docs.python.org/dev/py3k/library/io.html Ah, you're right. > Small note about patch: > 1) IOError string says "read() on write-only...", should be "peek() on write-only..." ? Indeed. > 2) Should be min() in self._read(max(self.max_read_chunk, n)) Actually, I think I should have reproduced the algorithm in read(), where there's a read_size distinct from the size requested by the user. Thanks for the review, it looks like I should have waited a bit before committing :) |
|||
msg117766 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月30日 22:37 | |
Here is a patch fixing these issues. |
|||
msg117782 - (view) | Author: Nir Aides (nirai) (Python triager) | Date: 2010年10月01日 10:01 | |
Should be min(n, 1024) instead of max(...) |
|||
msg117785 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年10月01日 11:15 | |
> Should be min(n, 1024) instead of max(...) Well, no, because we want to buffer a non-trivial amount of bytes for the next accesses. So, if n < 1024, buffer at least 1024 bytes. |
|||
msg117786 - (view) | Author: Nir Aides (nirai) (Python triager) | Date: 2010年10月01日 11:39 | |
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? |
|||
msg117788 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年10月01日 11:58 | |
> 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(): 1) there is no chunking (peek() should do at most one raw read) 2) huge reads are not really the use case peek() is intended for |
|||
msg117986 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年10月04日 21:55 | |
I've committed the improvements in r85221. Thank you! |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022年04月11日 14:57:06 | admin | set | github: 54171 |
2010年10月04日 21:55:55 | pitrou | set | status: open -> closed messages: + msg117986 |
2010年10月01日 11:58:00 | pitrou | set | messages: + msg117788 |
2010年10月01日 11:39:24 | nirai | set | messages: + msg117786 |
2010年10月01日 11:15:58 | pitrou | set | messages: + msg117785 |
2010年10月01日 10:01:54 | nirai | set | messages: + msg117782 |
2010年09月30日 22:37:01 | pitrou | set | files:
+ gzipfixup.patch messages: + msg117766 |
2010年09月30日 22:26:03 | pitrou | set | status: closed -> open |
2010年09月30日 17:01:14 | pitrou | set | messages: + msg117752 |
2010年09月30日 08:03:05 | nirai | set | messages: + msg117706 |
2010年09月29日 10:50:07 | pitrou | set | status: open -> closed resolution: fixed messages: + msg117594 stage: patch review -> resolved |
2010年09月28日 22:04:01 | pitrou | set | stage: needs patch -> patch review |
2010年09月28日 21:35:10 | pitrou | set | files:
+ gzippeek2.patch messages: + msg117552 |
2010年09月27日 23:56:49 | pitrou | set | files:
+ gzippeek.patch keywords: + patch messages: + msg117491 |
2010年09月27日 21:38:34 | pitrou | create |