-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
"%" is not escaped in path, user and password in URL.build() #502
Comments
Is it a bug report or a feature request? AFAIU it's not explicitly documented (nor tested) how this API should behave. I think we need to do this first in order to decide how to move forward. cc @asvetlov |
It looks like a bug. The path is interpreted as (partially) encoded while |
Fair enough. This does seem inconsistent. FWIW the note @ https://yarl.readthedocs.io/en/latest/api.html#yarl.URL says:
Even though it's written in one place, it seems to be referring to any uses of the From what I can gather, you're supposed to take care of doing encoding by yourself if you use This is why I originally stated that the corner cases are poorly documented. |
P.S. It's worth nothing that yarl relies on stdlib urllib.parse and I have a hunch that it may affect some of the behaviors. It definitely needs more explicit test cases. |
Seems the problem is due to using the same quoters for |
There is the same issue with
|
Thanks for this fix! It addresses a major issue with getting Unicode values in and out intact. Although, I should note that, the change, although fixing a bug, was a large change in behavior for the main API, and is probably breaking many application code, such as My suggestion would have been to roll this out as a major-version update, considering it a API-breaking change. I guess it's a bit too late for that, though. But, worth considering if something like this happen again, or someone thinks it's really worth making that happen now. |
Fix dependencies. 1.6.0 (2020-09-23) ================== Features -------- - Allow for int and float subclasses in query, while still denying bool. `#492 <https://github.com/aio-libs/yarl/issues/492>`_ Bugfixes -------- - Do not requote arguments in ``URL.build()``, ``with_xxx()`` and in ``/`` operator. `#502 <https://github.com/aio-libs/yarl/issues/502>`_ - Keep IPv6 brackets in ``origin()``. `#504 <https://github.com/aio-libs/yarl/issues/504>`_
https://build.opensuse.org/request/show/838272 by user dirkmueller + dimstar_suse - update to 1.6.0: - Allow for int and float subclasses in query, while still denying bool. `#492 <https://github.com/aio-libs/yarl/issues/492>`_ - Do not requote arguments in ``URL.build()``, ``with_xxx()`` and in ``/`` operator. `#502 <https://github.com/aio-libs/yarl/issues/502>`_ - Keep IPv6 brackets in ``origin()``. `#504 <https://github.com/aio-libs/yarl/issues/504>`_
All other parts are properly escaped. For example:
yarl 1.5.1
The text was updated successfully, but these errors were encountered: