-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
RFC3986 compatible URL.join honoring empty segments again #1082
Conversation
Thanks for following up 👍 |
urllib.parse.urljoin does not honor empty segments, python/cpython#84774 implement using joinpath change query string generation to not emit empty values as ""
always encode parameters with an assignment adjust rfc3986 tests to include an assignment in the expectation
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
Pushed a fix for the new test cases. If there are any other cases to test, that you can think of that might break it, it would be great to add them. I think we are a bit light on tests for joining encoded paths. I've got to get some sleep now. |
possible without make_child |
Nice! Now I really have to get some sleep. Cheers |
I think this is ready to go. Some small nits above, and maybe there’s more coverage to add? |
I added some more coverage and cleaned up the message a bit |
I should have time to do another release for this fix later today |
Still doing testing with this, but I think its good to go if the CI passes and the performance testing looks ok |
Performance testing looks good. |
Thanks for sticking with this one @commonism |
It was not easy, but a pleasure. |
This is a revised version of #1039 using encoded arguments to work around issues with + in query segments.
It uses encoded=True for the parts when building the URL and normalizes the path itself.
What do these changes do?
The changes re-implement URL.join within yarl.URL instead of using urllib.parse.urljoin to avoid known issues when joining paths with empty segments (python/cpython#84774)
Are there changes in behavior for the user?
Due to the unit tests for URL.join it was required to align the query parameter rendering to match the unit tests, empty parameters are rendered without value therefore instead of an empty value.
Related issue number
#1066
Checklist