★ wanayoo — archive 1999 https://github.com/MagicStack/uvloop/issues/196Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UVLoop raises "requires a DNS lookup" on Unix Domain Sockets #196

Closed
pax0r opened this issue Sep 18, 2018 · 0 comments
Closed

UVLoop raises "requires a DNS lookup" on Unix Domain Sockets #196

pax0r opened this issue Sep 18, 2018 · 0 comments

Comments

@pax0r
Copy link
Contributor

@pax0r pax0r commented Sep 18, 2018

  • uvloop version: 0.11.2
  • Python version: 3.7
  • Platform: Debian 9.5
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: yes

When using uvloop with Unix Domain Sockets uvloop.loop.UDPTransport.sendto raises ValueError: UDP.sendto(): address '(socket path)' requires a DNS lookup which is wrong, as there are no DNS lookups for Unix Domain Sockets.

Original Python aioloop works without any problems with this.

I think this can be related to #91

Code to reproduce:

import asyncio
import os
import random
import socket
import string

import uvloop


asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())


def create_sock(path):
    try:
        os.unlink(path)
    except FileNotFoundError:
        pass
    s = socket.socket(socket.AF_UNIX, type=socket.SOCK_DGRAM)
    s.bind(path)
    return s


async def main():
    # Get a reference to the event loop as we plan to use
    # low-level APIs.
    loop = asyncio.get_running_loop()

    message = "Hello World!"
    filename = '/tmp/{}'.format(''.join(random.choice(string.ascii_letters) for i in range(30)))
    sock = create_sock(filename)

    transport, protocol = await loop.create_datagram_endpoint(
        lambda: asyncio.DatagramProtocol(),
        sock=sock)

    transport.sendto(message.encode(), filename)

asyncio.run(main())
@pax0r pax0r changed the title UVLoop raises ' UVLoop raises "requires a DNS lookup" on Unix Domain Sockets Sep 18, 2018
@1st1 1st1 closed this in #204 Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.