`asyncio.Protocol.data_received` should also accept `bytearray` alongside `bytes`
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 5.1k
- Forks
- 2.1k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 82
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par comparer la déclaration de typeshed pour asyncio.Protocol.data_received avec le chemin d’exécution montré dans Lib/asyncio/proactor_events.py, en particulier _ProactorReadPipeTransport et l’appel à data_received. Consultez l’issue CPython associée avant de décider si la correction doit être apportée dans typeshed, puis mettez à jour l’annotation afin que bytearray soit représenté et vérifiez que les vérifications de stubs pertinentes passent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100