Skip to content

AssertionError when self.connection is not None in handle_async_request / _attempt_to_acquire_connection #621

Description

@Zac-HD
Traceback (most recent call last):
...
File "/python3.10/site-packages/httpx/_client.py", line 1848, in postreturnawaitself.request(
File "/python3.10/site-packages/httpx/_client.py", line 1533, in requestreturnawaitself.send(request, auth=auth, follow_redirects=follow_redirects)
File "/python3.10/site-packages/httpx/_client.py", line 1620, in send
response =awaitself._send_handling_auth(
File "/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
response =awaitself._send_handling_redirects(
File "/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
response =awaitself._send_single_request(request)
File "/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
response =await transport.handle_async_request(request)
File "/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp =awaitself._pool.handle_async_request(req)
File "/python3.10/site-packages/httpcore/_async/connection_pool.py", line 221, in handle_async_requestawaitself._attempt_to_acquire_connection(status)
File "/python3.10/site-packages/httpcore/_async/connection_pool.py", line 160, in _attempt_to_acquire_connection
status.set_connection(connection)
File "/python3.10/site-packages/httpcore/_async/connection_pool.py", line 22, in set_connectionassertself.connection isNone
AssertionError

Like #615 this was fine in 0.15 but broken in 0.16.1; it might also be related to #613. I don't have a good repro yet.

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