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

Misleading exception stack #139

Closed
kyuupichan opened this issue Apr 12, 2018 · 2 comments
Closed

Misleading exception stack #139

kyuupichan opened this issue Apr 12, 2018 · 2 comments
Labels

Comments

@kyuupichan
Copy link

kyuupichan commented Apr 12, 2018

  • uvloop version: 0.9.1
  • Python version: 3.6.4
  • Platform: MacOSX
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Yes

Running the below with uvloop policy commented out results in an expected error:

ConnectionRefusedError: [Errno 61] Connect call failed ('127.0.0.1', 1)

Running with uvloop policy uncommented:

TypeError: getsockaddrarg() takes exactly 2 arguments (4 given)

This led me on a wild goose chase for a while...

import asyncio
import socket
import uvloop

def lss(address):
    loop = asyncio.get_event_loop()
    sock = socket.socket()
    sock.setblocking(False)
    coro = loop.sock_connect(sock, address)
    loop.run_until_complete(coro)

asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
lss(('localhost', 1))
@asvetlov
Copy link
Contributor

IPv6 address?

@kyuupichan
Copy link
Author

Well the asyncio error has an IPv4 one. I'm not sure what else you're asking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants