`asyncio.Protocol.data_received` should also accept `bytearray` alongside `bytes`
Asyncio's _ProactorReadPipeTransport can also feed bytearray objects in the data_received callback from asyncio.Protocol.
- First,
self._datais abytearrayhere: https://github.com/python/cpython/blob/f8a736b8e14ab839e1193cb1d3955b61c316d048/Lib/asyncio/proactor_events.py#L191 - This gets passed to `self._data_received here: https://github.com/python/cpython/blob/f8a736b8e14ab839e1193cb1d3955b61c316d048/Lib/asyncio/proactor_events.py#L230
- The passed into
Protocol.data_receivedhere: https://github.com/python/cpython/blob/f8a736b8e14ab839e1193cb1d3955b61c316d048/Lib/asyncio/proactor_events.py#L274
Shall I make a PR with a fix for this?
Related cpython issue: https://github.com/python/cpython/issues/123496 - I'm not sure whether or not it should be fixed in the stdlib instead.
It looks like it was fixed in cpython v3.12.0a4 thanks to this commit: https://github.com/python/cpython/commit/1bb68ba6d9de6bb7f00aee11d135123163f15887
What do we do in this case? Put an if sys.version_info < (3, 12): in place?
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.