Skip to content

create_datagram_endpoint does not work with IPv6 #108

@chrysn

Description

@chrysn
  • uvloop version: 0.8.1
  • Python version: 3.5.4rc1
  • Platform: Debian GNU/Linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: yes

While the default asyncio main loop can easily accept both IPv4 and IPv6 addresses n create_datagram_endpoint(remote_addr=...), uvloop accepts IPv4 address only.

The attached example shows this; call it ./echo.py 0 127.0.0.1 and ./echo.py 0 ::1 to use asyncio's main loop and try to reach localhost:9999 (usually gives you "Connection refused" errors for both). Running it as ./echo 1 127.0.0.1 sends the datagram using uvloop (it doesn't show an error, but that's probably a different bug), and running it as ./echo 1 ::1 tries IPv6 on uvloop, but raises a socket.gaierror: [Errno -9] Address family for hostname not supported.

The example is almost verbatim the example from the Python documentation, adapted to take arguments and start uvloop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions