Patch #817854: Add missing operations for SSLFile. Fixes #792101.

Backported to 2.3.
This commit is contained in:
Martin v. Löwis 2003-10-27 14:07:53 +00:00
parent 98779e0e36
commit 11892ecd6d
1 changed files with 25 additions and 0 deletions

View 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: