[Python-checkins] cpython (3.2): Fix-up for 0f362676460d: add missing size argument to SSLFakeFile.readline(),
georg.brandl
python-checkins at python.org
Tue Sep 30 16:32:10 CEST 2014
https://hg.python.org/cpython/rev/4065c4539fcb
changeset: 92671:4065c4539fcb
branch: 3.2
user: Georg Brandl <georg at python.org>
date: Tue Sep 30 16:31:21 2014 +0200
summary:
Fix-up for 0f362676460d: add missing size argument to SSLFakeFile.readline(), as in 2.6 backport 8a6def3add5b
files:
Lib/smtplib.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
old mode 100644
new mode 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -189,10 +189,14 @@
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
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list