MagicStack / MagicStack/uvloop

Failed to create_datagram_endpoint() with AF_UNIX family

Open
#403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

missing feature
Dominant language
Cython
Stars
11.9k
Forks
616
PR merge metrics
No merged PRs in 30d

Description

  • uvloop version: 0.15.2
  • Python version: 3.7.3
  • Platform: Debian GNU/Linux 10
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?:
  • Does uvloop behave differently from vanilla asyncio? How?: asyncio correctly creates datagram unix socket

Code, works correctly using default event loop:

res = await loop.create_datagram_endpoint(MyProto, local_addr='/tmp/my_unix_sock', family=socket.AF_UNIX)

Trace:

Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1494, in uvloop.loop.Loop.run_until_complete
  File "./my_app.py", line 75, in main
    family = socket.AF_UNIX)
  File "uvloop/loop.pyx", line 3023, in create_datagram_endpoint
TypeError: local_addr must be a tuple of (host, port)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at uvloop/loop.pyx in create_datagram_endpoint around the reported line and run the supplied AF_UNIX reproducer, comparing its behavior with vanilla asyncio. Done means a datagram UNIX socket can be created with the shown local_addr and AF_UNIX family without breaking existing tuple-based endpoints.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.