BaseStreamFileLike: handle reads that return None

Fixes #555.
This commit is contained in:
Jimmy Zelinskie 2015-09-30 16:24:04 -04:00
parent abe43a0e07
commit ffeb99d4ee
2 changed files with 12 additions and 1 deletions

View file

@ -15,6 +15,8 @@ class BaseStreamFilelike(object):
def read(self, size=READ_UNTIL_END):
buf = self._fileobj.read(size)
if buf is None:
return None
self._cursor_position += len(buf)
return buf