MagicStack/uvloop

UDPTransport returning when data is empty

ordinary-jamie opened this issue · 0 comments

  • 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 python/cpython#113812). Note that the public API in uvloop references the Python asyncio behaviour.

if not data:
# Replicating asyncio logic here.
return