MagicStack / MagicStack/uvloop
UDPTransport returning when data is empty
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 616
- PR merge metrics
- No merged PRs in 30d
Description
* **uvloop version**:
* **Python version**: <3.13
* **Platform**: MacOS
* **Can you reproduce the bug with `PYTHONASYNCIODEBUG` in env?**:
* **Does uvloop behave differently from vanilla asyncio? How?**: There is a change made in CPython 3.13 to remove this behaviour.
The Datagram transport in both `asyncio.DatagramTransport` and `uvloop.UDPTransport` will return and ignore calls to `sendto` if the data is empty. This prohibits users from sending zero-length datagrams.
The behaviour will be removed in CPython 3.13 (see https://github.com/python/cpython/issues/113812). Note that the public API in `uvloop` references the Python `asyncio` behaviour.
https://github.com/MagicStack/uvloop/blob/6c770dc3fbdd281d15c2ad46588c139696f9269c/uvloop/handles/udp.pyx#L284-L286
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at uvloop/handles/udp.pyx lines 284-286, where UDPTransport currently returns for empty data, and compare the referenced CPython 3.13 change. Done means sendto no longer ignores zero-length datagrams while preserving the documented asyncio transport behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100