From 1a94f3a1b8117f71508e45c31e9368ae321cff8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 27 Oct 2003 14:07:43 +0000 Subject: [PATCH] Patch #817854: Add missing operations for SSLFile. Fixes #792101. --- Lib/httplib.py | 25 +++++++++++++++++++++++++ Misc/NEWS | 2 ++ 2 files changed, 27 insertions(+) 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. -- 2.47.3