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

aiohttp.ClientSession read_timeout is deprecated #107

Open
chuckwondo opened this issue Jun 4, 2022 · 3 comments
Open

aiohttp.ClientSession read_timeout is deprecated #107

chuckwondo opened this issue Jun 4, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@chuckwondo
Copy link

When using pfun.http (pfun 0.13.1), I get the following deprecation warning:

.../pfun/http.py:104: DeprecationWarning: read_timeout is deprecated, use timeout argument instead
@chuckwondo
Copy link
Author

It looks like you should simply change the default value of read_timeout to aiohttp.client.sentinel (like you do for timeout) instead of None.

@chuckwondo
Copy link
Author

As a means to silence the deprecation warning, we can do this, for example:

import aiohttp
from pfun.http import HTTP

class Env:
    http = HTTP(read_timeout=aiohttp.helpers.sentinel)

Notice also that sentinel appears to have moved from aiohttp.client to aiohttp.helpers, or perhaps it has always been there, but using aiohttp.client.sentinel causes pyright to produce the error message "sentinel" is not exported from module "aiohttp.client", whereas using aiohttp.helpers.sentinel does not.

@suned suned added the enhancement New feature or request label Jun 9, 2022
@chuckwondo
Copy link
Author

I see that both read_timeout and conn_timeout were deprecated in aiohttp 3.5.0 (2018-12-22), so perhaps these should be removed from the pfun.http.HTTP constructor altogether (or at least deprecated in pfun as well).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants