Closed
Description
- 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))