Skip to content

TUNNEL_ONLY proxy mode fails #54

Description

@yeraydiazdiaz

From https://github.com/encode/httpx/issues/859#issuecomment-611206532

Traceback (most recent call last):
File "client.py", line 13, in fetch
r = await client.get(target)
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1279, in get
return await self.request(
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1121, in request
response = await self.send(
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1142, in send
response = await self.send_handling_redirects(
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1169, in send_handling_redirects
response = await self.send_handling_auth(
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1206, in send_handling_auth
response = await self.send_single_request(request, timeout)
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1238, in send_single_request
) = await dispatcher.request(
File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.8/site-packages/httpcore/_async/http_proxy.py", line 81, in request
return await self._tunnel_request(
File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.8/site-packages/httpcore/_async/http_proxy.py", line 155, in _tunnel_request
proxy_response = await connection.request(
File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.8/site-packages/httpcore/_async/connection.py", line 52, in request
assert url[:3] == self.origin
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "client.py", line 24, in <module>
loop.run_until_complete(main())
File "/Users/florimond/.pyenv/versions/3.8.2/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "client.py", line 20, in main
await asyncio.gather(*tasks)
File "client.py", line 15, in fetch
num_ok += 1
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1454, in __aexit__
await self.aclose()
File "/Users/florimond/Developer/python-projects/httpx/httpx/_client.py", line 1443, in aclose
await proxy.aclose()
File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 275, in aclose
await self._remove_from_pool(connection)
File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 258, in _remove_from_pool
self._connection_semaphore.release()
File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.8/site-packages/httpcore/_backends/asyncio.py", line 210, in release
self.semaphore.release()
File "/Users/florimond/.pyenv/versions/3.8.2/lib/python3.8/asyncio/locks.py", line 533, in release
raise ValueError('BoundedSemaphore released too many times')
ValueError: BoundedSemaphore released too many times

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions