summaryrefslogtreecommitdiffstats
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-05-24 21:47:49 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-05-24 21:47:49 (GMT)
commit1f4560c872f56e0d416dd091e9dbccbb93f716ba (patch)
tree99bd1b714ad78587ff9157370c774ba375b0aaac /Lib/imaplib.py
parent17dc81951acac1e6e6488357085003b3d9a9f48f (diff)
downloadcpython-1f4560c872f56e0d416dd091e9dbccbb93f716ba.zip
cpython-1f4560c872f56e0d416dd091e9dbccbb93f716ba.tar.gz
cpython-1f4560c872f56e0d416dd091e9dbccbb93f716ba.tar.bz2
Issue #1441530: In imaplib, read the data in one chunk to speed up large
reads and simplify code.
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 142e27b..1b54065 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -249,15 +249,7 @@ class IMAP4:
def read(self, size):
"""Read 'size' bytes from remote."""
- chunks = []
- 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)
+ return self.file.read(size)
def readline(self):