summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-08-04 01:00:29 (GMT)
committerGitHub <noreply@github.com>2020-08-04 01:00:29 (GMT)
commit1d16229f3f5b91f2389c7c5c6425c5524c413651 (patch)
treec498487c3ac4b778d353ba744c72f397bd714112 /Lib
parentb6724be8047ac2404aab870d35d8f95bb0b7036a (diff)
downloadcpython-1d16229f3f5b91f2389c7c5c6425c5524c413651.zip
cpython-1d16229f3f5b91f2389c7c5c6425c5524c413651.tar.gz
cpython-1d16229f3f5b91f2389c7c5c6425c5524c413651.tar.bz2
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
On Windows, fix asyncio recv_into() return value when the socket/pipe is closed (BrokenPipeError): return 0 rather than an empty byte string (b''). (cherry picked from commit 602a971a2af3a685d625c912c400cadd452718b1) Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/windows_events.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index c07fe32..a6759b7 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -469,7 +469,7 @@ class IocpProactor:
else:
ov.ReadFileInto(conn.fileno(), buf)
except BrokenPipeError:
- return self._result(b'')
+ return self._result(0)
def finish_recv(trans, key, ov):
try: