Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve default total timeout when other timeout is changed in ClientSession.__init__() #7274

Open
1 task done
wombatonfire opened this issue May 8, 2023 · 0 comments · May be fixed by #7275
Open
1 task done

Comments

@wombatonfire
Copy link

Is your feature request related to a problem?

Original discussion #7268

It's easy to unintentionally overwrite the default total timeout value when changing another, more specific, client timeout:

timeout = ClientTimeout()
print(timeout.total) # 300, default value

timeout = ClientTimeout(connect=5.0)
print(timeout.total) # None, default value is lost

ClientTimeout.total should be preserved when any other timeout is changed, but the total timeout value is not explicitly specified.

Describe the solution you'd like

As suggested in the original discussion, the default 5-minute timeout value should be set directly in the ClientTimeout class, not later in the ClientSession.

Describe alternatives you've considered

An alternative solution could've been changing the documentation and describing the behavior there, leaving the responsibility to explicitly specify the total timeout value to the user.

Related component

Client

Additional context

The issue is created in preparation for the PR.

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@wombatonfire wombatonfire linked a pull request May 8, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant