-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
requests 2.32.3 with IPv6 link local address fails with error: [Errno -2] Name or service not known #6735
Comments
I worked around the bug with:
|
Hello, I hit the problem too when using python3-requests-2.32.3-2.
I found the problem is caused by the changes in this commit c0813a2
When the url contains IPv6 address, urllib.urlparse.hostname does not contain the chars "[" "]", but urllib3.util.url._normalize_host matches ipv6 host with chars "[" "]". so the exception is thrown out. The fix could be using urllib3.util.parse_url() instead of urlparse()
OR using netloc instead of hostname
@sigmavirus24 @nateprewitt What do you think of it? Here are my system information
and my debug logs, I adding some print messages into code to debug the issue.
When using urllib3.util.parse_url, the logs are
When using netloc instead of hostname, the logs are
|
When using an IPv6 link local address with requests > v2.31.0, seeing an error
[Errno -2] Name or service not known
. The same works with requests 2.31.0.urllib3 2.2.1 also works successfully with IPv6 link local address .
urllib3 2.2.1 with IPv6 link local address
requests 2.31.0 with IPv6 link local address
Expected Result
Successful connection with versions 2.32.x
Actual Result
Reproduction Steps
System Information
The text was updated successfully, but these errors were encountered: