New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StreamWriter.drain() unreliably reports closed sockets #69627
Comments
async def bug():
reader, writer = await asyncio.open_connection("::1", "1066")
while True:
writer.write("foo\n".encode())
await writer.drain()
# Uncommenting this makes drain() raise BrokenPipeError
# when the server closes the connection.
#await asyncio.sleep(0.1)
loop = asyncio.get_event_loop()
loop.run_until_complete(bug())
|
See also this upstream git issue: python/asyncio#263. Let me know whether the patch suggested there works for you, and I'll prioritize getting it checked in. (Help would also be appreciated, e.g. in the form of a unittest.) |
Yes, this patch fixes the problem (in both this example and my real application). Thanks! |
Fixed by 17f76258d11d, d30fbc55194d and 08adb4056b5f. |
New changeset 17f76258d11d by Guido van Rossum in branch '3.4': New changeset d30fbc55194d by Guido van Rossum in branch '3.5': New changeset 08adb4056b5f by Guido van Rossum in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: