-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Things to check first
-
I have searched the existing issues and didn't find my bug already reported there
-
I have checked that my bug is still present in the latest release
AnyIO version
4.4.0
Python version
3.11
What happened?
StreamProtocol
, here: https://github.com/agronholm/anyio/blob/master/src/anyio/_backends/_asyncio.py#L1075
incorrectly assumes that it will only get bytes
objects as an argument. Unfortunately, on Windows, that's not the case. For the ProactorEventLoop
, we'll get bytearray
objects here.
See:
asyncio.Protocol.data_received
should also acceptbytearray
alongsidebytes
python/typeshed#12606asyncio.BaseProactorEventLoop
feeds bytearray objects to theProtocol.data_received
callback, contradicting docs python/cpython#123496
I think the quickest fix for anyio is to accept bytearray
as well, and convert it into bytes
, regardless of what typeshed/cpython do.
How can we reproduce the bug?
(Sorry, I don't have access to a Windows machine right now to create an example, but please let me know if an example script is needed.)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working