diff --git a/smart_open/webhdfs.py b/smart_open/webhdfs.py index 5ac35c61..d24d3554 100644 --- a/smart_open/webhdfs.py +++ b/smart_open/webhdfs.py @@ -114,11 +114,11 @@ def read(self, size=None): try: while len(self._buf) < size: - self._buf += self._response.raw.readline() + self._buf += self._response.raw.read(io.DEFAULT_BUFFER_SIZE) except StopIteration: pass - self._buf, retval = self._buf[size:], retval[:size] + self._buf, retval = self._buf[size:], self._buf[:size] return retval def read1(self, size=-1):