python / asyncio

asyncio historical repository
https://docs.python.org/3/library/asyncio.html
1.05k stars 178 forks source link

BufferedReader.readexactly() does not check for EOF #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
     def readexactly(self, n):
         """COUROUTINE: Read exactly n bytes, or until EOF."""
         blocks = []
         count = 0
         while n > count:
             block = yield from self.read(n - count)
+            if not block:
+                break
             blocks.append(block)
             count += len(block)
         return b''.join(blocks)

Original issue reported on code.google.com by shibt...@gmail.com on 4 Nov 2012 at 4:53

GoogleCodeExporter commented 9 years ago
This was fixed.  (Seems I am not getting notifications when bugs are reported.)

Original comment by gvanrossum@gmail.com on 10 Jan 2013 at 8:22