mirror of https://github.com/python/cpython
Issue #1441530: In imaplib, read the data in one chunk to speed up large
reads and simplify code.
This commit is contained in:
parent
17dc81951a
commit
1f4560c872
|
@ -249,15 +249,7 @@ class IMAP4:
|
||||||
|
|
||||||
def read(self, size):
|
def read(self, size):
|
||||||
"""Read 'size' bytes from remote."""
|
"""Read 'size' bytes from remote."""
|
||||||
chunks = []
|
return self.file.read(size)
|
||||||
read = 0
|
|
||||||
while read < size:
|
|
||||||
data = self.file.read(min(size-read, 4096))
|
|
||||||
if not data:
|
|
||||||
break
|
|
||||||
read += len(data)
|
|
||||||
chunks.append(data)
|
|
||||||
return b''.join(chunks)
|
|
||||||
|
|
||||||
|
|
||||||
def readline(self):
|
def readline(self):
|
||||||
|
|
|
@ -161,6 +161,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #1441530: In imaplib, read the data in one chunk to speed up large
|
||||||
|
reads and simplify code.
|
||||||
|
|
||||||
- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
|
- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
|
||||||
correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
|
correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue