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

UnicodeEncodeError in furl.join using Python 2.7 #58

Closed
jeffbr13 opened this issue Jan 20, 2016 · 2 comments
Closed

UnicodeEncodeError in furl.join using Python 2.7 #58

jeffbr13 opened this issue Jan 20, 2016 · 2 comments

Comments

@jeffbr13
Copy link

Loving furl, it's a great interface for URL-handling! Found this inconsistency in the API while using Python 2.7:

e.g.

# works fine
>>> furl(u'http://example.org/?kødpålæg=42')
furl('http://example.org/?k%C3%B8dp%C3%A5l%C3%A6g=42')

# fails
>>> furl('http://example.org').join(u'/?kødpålæg=42')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    furl('http://example.org').join(u'/kødpålæg=42')
  File "/Users/jeffbr/.virtualenvs/clipper/lib/python2.7/site-packages/furl/furl.py", line 1260, in join
    self.load(urljoin(self.url, str(url)))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 2: ordinal not in range(128)

Related to #33 where you fixed furl.__init__, but no sanitation seems to be done for Python 2's unicode strings in urljoin?

@gruns
Copy link
Owner

gruns commented Jan 26, 2016

Fixed in furl v0.4.91. Update with

$ pip install furl --upgrade

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

@gruns gruns closed this as completed Jan 26, 2016
@jeffbr13
Copy link
Author

Brilliant, cheers!

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