summaryrefslogtreecommitdiff
path: root/Lib/asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index e0025397fa..90de8587a3 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -861,7 +861,7 @@ class BaseEventLoop(events.AbstractEventLoop):
read = await self.run_in_executor(None, file.readinto, view)
if not read:
break # EOF
- await self.sock_sendall(sock, view)
+ await self.sock_sendall(sock, view[:read])
total_sent += read
return total_sent
finally:
@@ -1145,7 +1145,7 @@ class BaseEventLoop(events.AbstractEventLoop):
if not read:
return total_sent # EOF
await proto.drain()
- transp.write(view)
+ transp.write(view[:read])
total_sent += read
finally:
if total_sent > 0 and hasattr(file, 'seek'):