diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 1b5b75ef566a32..9c7faa26bb4bd4 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -941,7 +941,7 @@ def read(self, size=-1): newpos = min(len(self._buffer), self._pos + size) b = self._buffer[self._pos : newpos] self._pos = newpos - return bytes(b) + return b.take_bytes() def read1(self, size=-1): """This is the same as read.