Skip to content
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

asyncio.Protocol.data_received should also accept bytearray alongside bytes #12606

Open
jonathanslenders opened this issue Aug 30, 2024 · 2 comments
Labels
topic: asyncio Asyncio-related issues

Comments

@jonathanslenders
Copy link
Contributor

jonathanslenders commented Aug 30, 2024

Asyncio's _ProactorReadPipeTransport can also feed bytearray objects in the data_received callback from asyncio.Protocol.

Shall I make a PR with a fix for this?

Related cpython issue: python/cpython#123496 - I'm not sure whether or not it should be fixed in the stdlib instead.

@jonathanslenders
Copy link
Contributor Author

It looks like it was fixed in cpython v3.12.0a4 thanks to this commit:
python/cpython@1bb68ba

What do we do in this case? Put an if sys.version_info < (3, 12): in place?

@srittau
Copy link
Collaborator

srittau commented Aug 30, 2024

Possibly add a version and a platform check. But considering that this is simply a (fixed) bug in the stdlib, I'd be fine with doing nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: asyncio Asyncio-related issues
Projects
None yet
Development

No branches or pull requests

3 participants