Add support for loop.sock_sendto
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- networking
Research direction
Start at the sock_sendto entry point in uvloop/loop.pyx, identified by the traceback, and compare its expected behavior with asyncio.loop.sock_sendto. Use the provided non-blocking UDP example to exercise the implementation. Done means the call sends the datagram and returns the number of bytes sent instead of raising NotImplementedError.
Written by the indexing model from the issue text.
Description
- uvloop version: 0.17.0 - 0.20.0
- Python version: 3.11.4 - 3.12.5
- Platform: Linux
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: Not a bug - Does uvloop behave differently from vanilla asyncio? How?: Yes, not implemented feature
The uvloop not implement method sock_sendto.
coroutine loop.sock_sendto(sock, data, address)
Send a datagram from sock to address. Asynchronous version of socket.sendto()Return the number of bytes sent.
sock must be a non-blocking socket.
New in version 3.11.
The simple test case that reproduces the problem:
#!/usr/bin/env python3
import socket
import asyncio
import uvloop
uvloop.install()
async def run():
addr = ("127.0.0.1", 1111)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setblocking(False)
loop = asyncio.get_running_loop()
await loop.sock_sendto(s, b'test', addr)
asyncio.run(run())
uvloop == 0.20.0 response:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "<stdin>", line 6, in run
File "uvloop/loop.pyx", line 2629, in sock_sendto
NotImplementedError
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 615
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicStack/uvloop
-
License not clear Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#759 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#741 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#702 · 8 comments · 9 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MagicStack/uvloop#766 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
MagicStack/uvloop#765 ·
All issues in MagicStack/uvloop
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-mgmt#28113 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
canonical/postgresql-watcher-operator#110 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EleutherAI/lm-evaluation-harness#4201 ·