Wrap read request, concatenating partial reads until whole request have been read

This commit is contained in:
Henrik Nordström 2010-09-05 21:04:22 +08:00 committed by Aldo Cortesi
parent e98a035540
commit 2e7e9f9759

View File

@ -192,6 +192,15 @@ class FileLike:
def flush(self):
pass
def read(self, length):
result = ''
while len(result) < length:
data = self.o.read(length)
if not data:
break
result += data
return result
def readline(self):
result = ''
while True: