Skip to content

ClientRequest's constructor makes a blocking IO call #10435

@cbornet

Description

@cbornet

Describe the bug

In ClientRequest's constructor there is a call to update_auth which in turn calls netrc_from_env.
netrc_from_env is blocking as it reads the .netrc file from the FS.
So instanciating ClientRequest in the event loop is blocking the loop.

This was detected by BlockBuster in #10433

To Reproduce

N/A

Expected behavior

I would expect ClientRequest to not block the asyncio loop.

Logs/tracebacks

N/A

Python Version

3.11

aiohttp Version

HEAD

multidict Version

6.1.0

propcache Version

0.2.1

yarl Version

1.18.3

OS

macOS

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions