<p dir="auto">Description of problem:</p>
<p dir="auto">Version-Release number of selected component (if applicable):</p>
<p dir="auto">How reproducible:<br>
always</p>
<p dir="auto">Steps to Reproduce:<br>
1.ip addr add fe80::1 dev p14p14<br>
2. nc -6 -l 1234<br>
3. python -c "import requests; requests.get('http://[fe80::1%25p14p1]:1234')"<br>
3. nc -v6 'fe80::1%p14p1' 1234<br>
Ncat: Version 6.40 ( <a href="http://nmap.org/ncat" rel="nofollow">http://nmap.org/ncat</a> )<br>
Ncat: Connected to fe80::1:1234.</p>
<p dir="auto">Actual results:<br>
The python script shows a traceback:<br>
Traceback (most recent call last):<br>
File "", line 1, in <br>
File "/usr/lib/python2.7/site-packages/requests/api.py", line 55, in get<br>
return request('get', url, *_kwargs)<br>
File "/usr/lib/python2.7/site-packages/requests/api.py", line 44, in request<br>
return session.request(method=method, url=url, *_kwargs)<br>
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 335, in request<br>
resp = self.send(prep, *_send_kwargs)<br>
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 438, in send<br>
r = adapter.send(request, *_kwargs)<br>
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 327, in send<br>
raise ConnectionError(e)<br>
requests.exceptions.ConnectionError: HTTPConnectionPool(host='fe80::1%25p14p1', port=1234): Max retries exceeded with url: / (Caused by &lt;class 'socket.gaierror'&gt;: [Errno -2] Name or service not known)</p>
<p dir="auto">Expected results:<br>
python requests should connect to netcat.</p>
<p dir="auto">Additional info:<br>
<a href="https://tools.ietf.org/html/rfc6874" rel="nofollow">https://tools.ietf.org/html/rfc6874</a></p>
<p dir="auto">Some IPv6 addresses contains the '%' sign ( link-local addresses : ex. fe80::21b:63ff:feab:e6a6%eth0 or [fe80::21b:63ff:feab:e6a6%eth0] )<br>
When using this addresses the requests library raises the fallowing exception: "requests.exceptions.InvalidURL: Invalid percent-escape sequence: 'et'"<br>
(raised by the function unquote_unreserved() from the utils.py).<br>
If I put as first line in this function the "return uri" line (in other words if I pass over this function), everything works ok.</p>