From: Martin v. Löwis Date: Mon, 27 Oct 2003 14:07:43 +0000 (+0000) Subject: Patch #817854: Add missing operations for SSLFile. Fixes #792101. X-Git-Tag: v2.3.3c1~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a94f3a1b8117f71508e45c31e9368ae321cff8a;p=thirdparty%2FPython%2Fcpython.git Patch #817854: Add missing operations for SSLFile. Fixes #792101. --- diff --git a/Lib/httplib.py b/Lib/httplib.py index 03adb43604bf..9832e474f834 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -910,6 +910,31 @@ class SSLFile(SharedSocketClient): self._buf = all[i:] return line + def readlines(self, sizehint=0): + total = 0 + list = [] + while True: + line = self.readline() + if not line: + break + list.append(line) + total += len(line) + if sizehint and total >= sizehint: + break + return list + + def fileno(self): + return self._sock.fileno() + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + class FakeSocket(SharedSocketClient): class _closedsocket: diff --git a/Misc/NEWS b/Misc/NEWS index 7b010f1eadbb..d36d360d1bb9 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,8 @@ Extension modules Library ------- +- Bug #792101: Add missing file operations for httplib.SSLFile. + - Bug #811082: test_tempfile fails if space in install directory. - Bug #780461: platform.mac_ver() raised MacOSError exception under OS X.