encode / httpx

A next generation HTTP client for Python. 🦋

Home Page:https://www.python-httpx.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot reuse already awaited aclose()/athrow()

alinemone opened this issue · comments

On Windows systems, when I use this method

async def get_api(cls):
a = await httpx.AsyncClient().get('https://api.publicapis.org/entries')
I get the following error

"type": "RuntimeError",
"message": "cannot reuse already awaited aclose()/athrow()",
"trace": [
    {
        "file": "E:\\Programs\\order\\venv\\lib\\site-packages\\httpx\\_client.py",
        "name": "_send_handling_auth",
        "line number": 1662,
        "line": "await auth_flow.aclose()"
    },

I commented line 1662 in the _client.py file
await auth_flow.aclose()

and the problem was solved, but I don't know if others have encountered the problem. This part has a problem on Windows