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

Use requests to quote URLs #169

Merged
merged 3 commits into from
Apr 30, 2021
Merged

Conversation

Matoking
Copy link
Contributor

The previous fix to #158 didn't match requests' own behavior and quoted a lot of additional characters, causing test breakage.

Use requests.utils.requote_uri to quote the URL instead, which should ensure the behavior matches requests more closely.


I did some brief testing: tests that broke with 1.9.0 (mostly due to : in the path component) now pass and spaces are now correctly escaped (the original issue mentioned in #158), while leaving most reserved characters untouched.

The previous fix to jamielennox#158 didn't match requests' own behavior
and quoted a lot of additional characters, causing test breakage.

Use `requests.utils.requote_uri` to quote the URL instead, which
should ensure the behavior matches requests more closely.
@jamielennox
Copy link
Owner

Thank you

Closes: #170

To make sure we don't break this again.
@anlambert
Copy link

I also confirm that fix is working. Some tests for packages in our project started to fail since requests-mock 1.9.0 release (see here and here). Once that fix applied, they go back to green.

@tomjw64
Copy link

tomjw64 commented Apr 29, 2021

1.9 caused some of my tests to fail also. This patch seems to resolve those failures.

@ktdreyer
Copy link

I've tested this branch and it works.

@jamielennox jamielennox merged commit 850671f into jamielennox:master Apr 30, 2021
@jamielennox
Copy link
Owner

Released as 1.9.2. Thanks everyone for the fast feedback, and very sorry this release was chaotic.

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.

5 participants