]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #817854: Add missing operations for SSLFile. Fixes #792101.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 27 Oct 2003 14:07:43 +0000 (14:07 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 27 Oct 2003 14:07:43 +0000 (14:07 +0000)
Lib/httplib.py
Misc/NEWS

index 03adb43604bfc8791cbc241527ae94c1d435b571..9832e474f834cc66ab6e62eb95b70f62e0b767f9 100644 (file)
@@ -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:
index 7b010f1eadbb0c91d92ae556e3164f214e21fda9..d36d360d1bb90e37b129af2d97cb30c6f107d4f0 100644 (file)
--- 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.