You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this appears to be an incompatibility in cachecontrol with the new release of urllib3 2.0. strict is no longer a supported argument on the HTTPResponse class. For the time being you'll likely need to pin to an older version of urllib3 or work with the cachecontrol team to update their usage.
Perhaps the fix would be to check urllib3's major version and expect a different HTTPResponse shape based on whether it is 1 or greater than 1.
Based on this diff it looks like strict isn't supported at all in python 3. Could we just do a plain ole getattr call to default to 0 if it's not present? Looks like that's what was happening upstream of this library anyways
Maintainer of urllib3 here! I'd recommend the getattr approach regardless of what gets done in urllib3 in the short-term, long-term the property won't be available on HTTPResponse or HTTPConnection (and defaults to True in terms of behavior).
elijahr, chapmanjacobd, mwrobel-merixstudio, peidrao, injun-hwang and 2 more
Activity
notenti commentedon May 3, 2023
What would make more sense here? Pinning
requests
so it's <2.30? Or updating the logic sostrict
isn't referenced?elijahr commentedon May 3, 2023
The comment on that issue suggests this is from urllib3 >= 2 being used: psf/requests#6437 (comment)
Perhaps the fix would be to check urllib3's major version and expect a different
HTTPResponse
shape based on whether it is 1 or greater than 1.notenti commentedon May 3, 2023
Based on this diff it looks like
strict
isn't supported at all in python 3. Could we just do a plain olegetattr
call to default to 0 if it's not present? Looks like that's what was happening upstream of this library anywayssww314 commentedon May 3, 2023
I believe the issue is actually urllib > 2.
Here is the issue in the urllib3 repo. As a work around pinning urllib version works.
The suggested
gettattr
solution seems like a clean fix in cachcontrol.urllib3/urllib3#3010
You can fix it by pinning:
urllib3==1.26.15 # https://pypi.org/project/urllib3/
sethmlarson commentedon May 3, 2023
Maintainer of urllib3 here! I'd recommend the
getattr
approach regardless of what gets done in urllib3 in the short-term, long-term the property won't be available onHTTPResponse
orHTTPConnection
(and defaults toTrue
in terms of behavior).ghost commentedon May 4, 2023
This issue came up today for us; the workaround was to use requests 2.29.0
poetry=1.4.2, fix for psf/cachecontrol/issues/292
88 remaining items
fix(#292): disuse HTTPResponse.strict (#301)
constraint urllib3 < 2
garchaaman19 commentedon Jun 7, 2023
This worked for me.
Update cachecontrol to 0.13.1
Temporarily downgrade to requests==2.29.0