[issue18524] BufferedReader.read1() documentation/implementation difference

Antoine Pitrou report at bugs.python.org
Thu Jul 25 00:04:19 CEST 2013


Antoine Pitrou added the comment:

Ah, well. This is already fixed, then:

Python 3.4.0a0 (default:ae769deb45b2, Jul 20 2013, 19:28:41) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import io
>>> raw = io.BytesIO(bytes(200))
>>> buffered = io.BufferedReader(raw, 10)
>>> while True:
...   buf = buffered.read1(20)
...   print("Got %d bytes" % len(buf))
...   if not buf:
...     break
... 
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 0 bytes


However, 3.2 didn't get that improvement, sorry. See changeset 27bf3d0b8e5f and issue #13393.

----------
resolution:  -> duplicate
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18524>
_______________________________________


More information about the Python-bugs-list mailing list