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

Existing path encoding is modified #55

Closed
tdhooper opened this issue Sep 16, 2015 · 2 comments
Closed

Existing path encoding is modified #55

tdhooper opened this issue Sep 16, 2015 · 2 comments

Comments

@tdhooper
Copy link

from furl import furl

furl('/some%2520path').url
-> '/some%20path'

furl('/some%252Bpath').url
-> '/some+path'

I was expecting the original encoding to be preserved.

@gruns
Copy link
Owner

gruns commented Sep 26, 2015

furl('/some%2520path').url
-> '/some%20path'

This is intended; furl expects percent-encoded URLs as input.

Furl handles encoding for you, and furl's philosophy on encoding is simple:  
whole path, query, and fragment strings should always be encoded.

furl then decodes %2520 to &20. However

furl('/some%252Bpath').url
-> '/some+path'

looks like a bug: the Path should not be decoded twice.

I would expect the final, decoded, URL path of /some%252Bpath to be /some%2Bpath, not /some+path.

I'll look into this.

gruns added a commit that referenced this issue Feb 21, 2017
…es Issues #55 and #84. Huge thanks to Thomas Hooper and Tom Dryer.
@gruns
Copy link
Owner

gruns commented Feb 21, 2017

This is now fixed in the latest furl v0.5.7.

>>> from furl import furl
>>> furl('/some%2520path').url
'/some%2520path'
>>> furl('/some%252Bpath').url
'/some%252Bpath'

Update with

pip install furl --upgrade

Thank you, again, for bringing this issue to my attention Thomas. Don't hesitate
to let me know if there's anything else I can do for you.

@gruns gruns closed this as completed Feb 21, 2017
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

No branches or pull requests

2 participants