Open pytech66 opened 5 months ago
I worked around the bug with:
# Workaround for bug in requests 2.32.x: https://github.com/psf/requests/issues/6735
def requests_workaround(method, url, json, headers, auth, verify=False):
# Create a session
session=requests.Session()
# Prepare the request
request=requests.Request(method, url, json=json, headers=headers, auth=auth)
prepared_request=session.prepare_request(request)
prepared_request.url=prepared_request.url.replace('%25', '%')
return session.send(prepared_request, verify=verify)
def requests_workaround_put(url, json, headers, auth, verify=False):
return requests_workaround('PUT', url, json, headers, auth, verify=False)
def requests_workaround_delete(url, headers, auth, verify=False):
return requests_workaround('DELETE', url, None, headers, auth, verify=False)
def requests_workaround_post(url, json, headers, auth, verify=False):
return requests_workaround('POST', url, json, headers, auth, verify=False)
def requests_workaround_get(url, headers, auth, verify=False):
return requests_workaround('GET', url, None, headers, auth, verify=False)
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