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

Prevent installation with urllib3 v2 #118

Merged
merged 1 commit into from
May 30, 2023
Merged

Conversation

Mr0grog
Copy link
Member

@Mr0grog Mr0grog commented May 30, 2023

Right now, this package is not compatible with urllib3 v2, so we need to set version constraints so package managers don’t try to install an incompatible version.

Partially covers #116.

Right now, this package is not compatible with urllib3 v2, so we need to set version constraints so package managers don’t try to install an incompatible version.

Partially covers #116.
@Mr0grog Mr0grog merged commit 618b1d5 into main May 30, 2023
10 checks passed
@Mr0grog Mr0grog deleted the 116-urllib3-v2-is-not-ok branch May 30, 2023 05:57
@Mr0grog Mr0grog mentioned this pull request Sep 25, 2023
3 tasks
Mr0grog added a commit that referenced this pull request Sep 26, 2023
Back in #118 we “fixed” things for urllib3 v2 by marking this package as only compatible with v1, so users wouldn't wind up with bad dependency combinations. This adds real, proper support for urllib3 v2. Fixes #116.

For the most part, urllib3 v2 just works, but there were two significant changes I had to make here:

1. We had a funky hack to deal with Wayback’s broken gzip handling that used the `from_httplib()` static method. That method no longer exists, and the new equivalent combines a bunch of other behavior that isn't really reasonable to override. Instead, we patch the `HTTPHeadersDict` class in v2.

2. VCR.py writes different, incompatible cassette files for v1 and v2 of urllib3 (see kevin1024/vcrpy#719). To address this in a way that doesn't make future contributions too hard, I added a custom serializer to make VCR behave compatibly between the two versions of urllib3, so you can record or read the same cassette files regardless of which version you are working with. It is no longer perfectly accurate to the response you received if using urllib3 v2, but it's generally good enough for our needs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant