-
Notifications
You must be signed in to change notification settings - Fork 123
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
cachecontrol is incompatible with Requests 2.30.0 #292
Comments
What would make more sense here? Pinning |
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 |
Based on this diff it looks like |
I believe the issue is actually urllib > 2. The suggested You can fix it by pinning: |
Maintainer of urllib3 here! I'd recommend the |
This issue came up today for us; the workaround was to use requests 2.29.0 |
Signed-off-by: bigcat88 <bigcat88@icloud.com>
It didn't help... |
We fixed by pinning urllib3:
The problem is not |
The lightest workaround is to set |
didn't work.. |
Tried this one too... same error |
I'm pretty sure this fixes the problem. I've deployed it on hundreds of projects using poetry that stopped working because of this. Can you elaborate what's not working? More details will help understand. :) |
@Shahard2 you have something else wrong then. Old urllib3 works fine. |
@sethmlarson Hey! Is it safe to just drop the |
Seems like Python std library dropped support way back in Python 3.4:
|
@ionrock It's safe to drop for urllib3 2.0 or Python 3+. In Python 2 on urllib3 1.26.x there is still functionally a difference between strict=True/False. Appreciate you jumping in to help here! Apologies for the suddenness of this issue surfacing, no one reported it during our prerelease period, unfortunately. |
@rdbisme Pinning the version isn't working for me either. Using poetry and GitHub Actions and here is the output I get when building:
Could it be that GitHub Actions uses its own version of cachecontrol which ignores anything set in |
depending on your poetry version, it might be the case that poetry itself depends on the affected versions of requests/urllib3, separately from your project in my case, poetry installs itself into a venv, so i found the venv, activated it, downgraded requests and urllib3 via |
This PR proposes to fix the release workflow and fix broken dependencies ref: psf/cachecontrol#292 (comment)
Given GHSA-j8r2-6x86-q33q, a fix here is increasingly important: packages that can't upgrade because of |
@woodruffw Requests is still compatible with urllib3 1.26.x so people using cachecontrol can continue using urllib3 1.26.x until cachecontrol adds support for urllib3 2.x. |
Hi, I have to move on to create a fork at https://github.com/frostming/cacheyou, with this issue addressed. The long term plan is if this project can continue I will merge the changes back. |
It doesn't seem that a fork will help in the case where this library is used as a transitive dependency where all installed packages must be in a requirements.txt file (e.g., typical serverless/paas configuration). |
agree, but it can mitigate the problem. |
* tests(ci): set fail-fast: false so that the whole test matrix is run * fix(ci): update matrix to use runners that support selected python versions * fix: omit `strict` attribute from response serialization The `strict` attribute of `HTTPResponse` is gone in `urllib3>=2.0`. In addition it has no effect, at least when running under Python 3. * fix: omit `strict` attribute during response deserialization This prevents issues when deserializing responses serialized by an earlier version of cachecontrol. * fix(test_etag): fix for requests>=2.29 Patch all the possible methods that might be used to generate a response.
fixes psf/cachecontrol#292 and #52
This worked for me. |
This version of cachecontrol uses an version of urllib3 that is incompatible with requests 2.30+, see psf/cachecontrol#292 It results in the following error: `AttributeError: 'HTTPResponse' object has no attribute 'strict'` This version update should solve this issue, but in case it doesn't, you could also fix `urllib3==1.26.15`
See psf/requests#6437
The text was updated successfully, but these errors were encountered: