Bug in parsing proxy connection string when username or password contains '@' #2984
Answered
by
tomchristie
tienanh-clevergroup
asked this question in
General
-
This is my example code import httpx
import asyncio
async def main():
async with httpx.AsyncClient(proxies="http://username:p@[email protected]:3128") as client:
response = await client.get("https://www.google.com/")
print(response.text)
asyncio.run(main()) My code runs with error and here is the traceback. I think this is a library error when parsing the proxy connection string. Traceback (most recent call last):
File "/home/tienanh/anaconda3/envs/test_env/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 190, in connect_tcp
addr_obj = ip_address(remote_host)
File "/home/tienanh/anaconda3/envs/test_env/lib/python3.10/ipaddress.py", line 54, in ip_address
raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'ssword%40127.0.0.1' does not appear to be an IPv4 or IPv6 address |
Beta Was this translation helpful? Give feedback.
Answered by
tomchristie
Dec 6, 2023
Replies: 1 comment
-
Thanks for raising this... I've escalated to #2985. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tomchristie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for raising this... I've escalated to #2985.