summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-30 14:31:21 (GMT)
committerGeorg Brandl <georg@python.org>2014-09-30 14:31:21 (GMT)
commit786c8e7dd565aecafb020683705564c42e62fedc (patch)
tree2e1520c27fad317f41c53ae6268100c7fcdadb1c
parente558181660d096e3e53c795bc5a528cdbd04eca6 (diff)
downloadcpython-786c8e7dd565aecafb020683705564c42e62fedc.zip
cpython-786c8e7dd565aecafb020683705564c42e62fedc.tar.gz
cpython-786c8e7dd565aecafb020683705564c42e62fedc.tar.bz2
Fix-up for 0f362676460d: add missing size argument to SSLFakeFile.readline(), as in 2.6 backport 8a6def3add5b
-rwxr-xr-x[-rw-r--r--]Lib/smtplib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index b03533e..cb36d28 100644..100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -189,10 +189,14 @@ else:
def __init__(self, sslobj):
self.sslobj = sslobj
- def readline(self):
+ def readline(self, size=-1):
+ if size < 0:
+ size = None
str = b""
chr = None
while chr != b"\n":
+ if size is not None and len(str) > size:
+ break
chr = self.sslobj.read(1)
if not chr:
break