uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

UDPTransport returning when data is empty

Open ordinary-jamie opened this issue 1 year ago • 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 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

ordinary-jamie avatar Feb 17 '24 02:02 ordinary-jamie