-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
ProactorEventLoop cannot open connection to ::1 #71687
Comments
The following code fails with "OSError: [WinError 10022] An invalid argument was supplied". import asyncio
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
loop.run_until_complete(asyncio.open_connection("::1", 4242)) This is a regression in 3.5.2. 3.5.1 does not have this bug. Connecting to 127.0.0.1 does not cause the problem. |
The first offending commit is this one: more specifically "return af, type, proto, '', (host, port)". For IPv6, it should be "(host, port, flow info, scope id)" instead of just "(host, port)". |
This is still a problem with Python 3.5.3 and 3.6.0. |
Any chance someone could look into this bug? |
The bug is reproducible on Python 3.7. The connect call always fails when I The bug can be bypassed by adding "%0" to the IPv6 address. This will cause cpython/Lib/asyncio/base_events.py Line 133 in e76ac9d
As mentioned by Sebastian, it happen because the _ipaddr_info function returns cpython/Lib/asyncio/base_events.py Line 142 in e76ac9d
This (host, port) tuple used in ConnectEx call, but it expect 4-element tuple Line 1090 in 55edd0c
Instead it tries to connect, using IPv4 and fails. The bug can be fixed by doing the following: instead of in cpython/Lib/asyncio/base_events.py Line 142 in e76ac9d
|
Somebody please submit a PR so this can be fixed in 3.7.1 and the fix can |
Somehow I overlooked this one when I was sifting the issues we needed to fix in 3.7. I've opened a PR. |
Thank you! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: