mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
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'').
This commit is contained in:
parent
bde48fd811
commit
602a971a2a
2 changed files with 4 additions and 1 deletions
|
|
@ -469,7 +469,7 @@ class IocpProactor:
|
||||||
else:
|
else:
|
||||||
ov.ReadFileInto(conn.fileno(), buf)
|
ov.ReadFileInto(conn.fileno(), buf)
|
||||||
except BrokenPipeError:
|
except BrokenPipeError:
|
||||||
return self._result(b'')
|
return self._result(0)
|
||||||
|
|
||||||
def finish_recv(trans, key, ov):
|
def finish_recv(trans, key, ov):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
On Windows, fix asyncio ``recv_into()`` return value when the socket/pipe is
|
||||||
|
closed (:exc:`BrokenPipeError`): return ``0`` rather than an empty byte
|
||||||
|
string (``b''``).
|
||||||
Loading…
Add table
Add a link
Reference in a new issue