summaryrefslogtreecommitdiffstats
path: root/Lib/io.py
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-06 23:47:23 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-06 23:47:23 (GMT)
commit4833b3c37fc0d33f8f3f37a9b7526150a7c64b8c (patch)
tree9cd8c04da7cf8dcc311f919187181ed3139db5c2 /Lib/io.py
parent8dc226fccd2183670ac19a85b89941f5b05167dc (diff)
downloadcpython-4833b3c37fc0d33f8f3f37a9b7526150a7c64b8c.zip
cpython-4833b3c37fc0d33f8f3f37a9b7526150a7c64b8c.tar.gz
cpython-4833b3c37fc0d33f8f3f37a9b7526150a7c64b8c.tar.bz2
Fixed a small bug introduced by r62778.
One of the codepaths of _BytesIO.read() returned a bytearray object, by mistake, when it should always return a bytes object. Interestingly, the fact this bug shown up probably means that some platforms are not using the new C-accelerated io.BytesIO.
Diffstat (limited to 'Lib/io.py')
-rw-r--r--Lib/io.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 3a1546a..a88b5a4 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -794,7 +794,7 @@ class _BytesIO(BufferedIOBase):
if n < 0:
n = len(self._buffer)
if len(self._buffer) <= self._pos:
- return self._buffer[:0]
+ return bytes(self._buffer[:0])
newpos = min(len(self._buffer), self._pos + n)
b = self._buffer[self._pos : newpos]
self._pos = newpos