{"action":"created","issue":{"url":"https://api.github.com/repos/gruns/furl/issues/72","repository_url":"https://api.github.com/repos/gruns/furl","labels_url":"https://api.github.com/repos/gruns/furl/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/gruns/furl/issues/72/comments","events_url":"https://api.github.com/repos/gruns/furl/issues/72/events","html_url":"https://github.com/gruns/furl/issues/72","id":154514298,"number":72,"title":"furl.url does not work properly with unicode in the url","user":{"login":"lisimia","id":1605884,"avatar_url":"https://avatars.githubusercontent.com/u/1605884?v=3","gravatar_id":"","url":"https://api.github.com/users/lisimia","html_url":"https://github.com/lisimia","followers_url":"https://api.github.com/users/lisimia/followers","following_url":"https://api.github.com/users/lisimia/following{/other_user}","gists_url":"https://api.github.com/users/lisimia/gists{/gist_id}","starred_url":"https://api.github.com/users/lisimia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisimia/subscriptions","organizations_url":"https://api.github.com/users/lisimia/orgs","repos_url":"https://api.github.com/users/lisimia/repos","events_url":"https://api.github.com/users/lisimia/events{/privacy}","received_events_url":"https://api.github.com/users/lisimia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-12T15:37:47Z","updated_at":"2016-06-29T03:44:24Z","closed_at":"2016-06-26T20:01:09Z","body":"````\r\nIn [16]: furl(u'/Assassin™-Harrows-80%-Tungsten-Soft-Tip-Darts-568-HDT1007.html')\r\n---------------------------------------------------------------------------\r\nUnicodeEncodeError                        Traceback (most recent call last)\r\n<ipython-input-16-72ee7b05fd36> in <module>()\r\n----> 1 furl(u'/Assassin™-Harrows-80%-Tungsten-Soft-Tip-Darts-568-HDT1007.html')\r\n\r\n/usr/local/lib/python2.7/site-packages/furl/furl.py in __init__(self, url, strict)\r\n    860         self.strict = strict\r\n    861\r\n--> 862         self.load(url)  # Raises ValueError on invalid url.\r\n    863\r\n    864     def load(self, url):\r\n\r\n/usr/local/lib/python2.7/site-packages/furl/furl.py in load(self, url)\r\n    873\r\n    874         if not isinstance(url, str):\r\n--> 875             url = str(url)\r\n    876\r\n    877         # urlsplit() raises a ValueError on malformed IPv6 addresses in\r\n\r\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\u2122' in position 9: ordinal not in range(128)\r\n+\r\n````\r\n\r\n\r\n````\r\nIn [1]: furl('http://www.wayfair.com/Assassin%25E2%2584%25A2-Harrows-80%2525-Tungsten-Soft-Tip-Darts-568-HDT1007.html')\r\nOut[1]: ---------------------------------------------------------------------------\r\nUnicodeDecodeError                        Traceback (most recent call last)\r\n/Library/Python/2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)\r\n    693                 type_pprinters=self.type_printers,\r\n    694                 deferred_pprinters=self.deferred_printers)\r\n--> 695             printer.pretty(obj)\r\n    696             printer.flush()\r\n    697             return stream.getvalue()\r\n\r\n/Library/Python/2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)\r\n    399                             if callable(meth):\r\n    400                                 return meth(obj, self, cycle)\r\n--> 401             return _default_pprint(obj, self, cycle)\r\n    402         finally:\r\n    403             self.end_group()\r\n\r\n/Library/Python/2.7/site-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)\r\n    519     if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:\r\n    520         # A user-provided repr. Find newlines and replace them with p.break_()\r\n--> 521         _repr_pprint(obj, p, cycle)\r\n    522         return\r\n    523     p.begin_group(1, '<')\r\n\r\n/Library/Python/2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)\r\n    701     \"\"\"A pprint that just redirects to the normal repr function.\"\"\"\r\n    702     # Find newlines and replace them with p.break_()\r\n--> 703     output = repr(obj)\r\n    704     for idx,output_line in enumerate(output.splitlines()):\r\n    705         if idx:\r\n\r\n/usr/local/lib/python2.7/site-packages/furl/furl.py in __repr__(self)\r\n   1266\r\n   1267     def __repr__(self):\r\n-> 1268         return \"%s('%s')\" % (self.__class__.__name__, str(self))\r\n   1269\r\n   1270\r\n\r\n/usr/local/lib/python2.7/site-packages/furl/compat.py in __str__(self)\r\n     21     else:  # Python 2\r\n     22         def __str__(self):\r\n---> 23             return self.__unicode__().encode('utf8')\r\n\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31: ordinal not in range(128)\r\n````\r\nHowever the follow works correctly\r\n````\r\nIn [20]: f = furl('/Assassin%25E2%2584%25A2-Harrows-80%2525-Tungsten-Soft-Tip-Darts-568-HDT1007.html')\r\n+\r\nIn [21]: f.path\r\nOut[21]: Path('/Assassin™-Harrows-80%-Tungsten-Soft-Tip-Darts-568-HDT1007.html')\r\n````\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gruns/furl/issues/comments/229248976","html_url":"https://github.com/gruns/furl/issues/72#issuecomment-229248976","issue_url":"https://api.github.com/repos/gruns/furl/issues/72","id":229248976,"user":{"login":"gruns","id":1041265,"avatar_url":"https://avatars.githubusercontent.com/u/1041265?v=3","gravatar_id":"","url":"https://api.github.com/users/gruns","html_url":"https://github.com/gruns","followers_url":"https://api.github.com/users/gruns/followers","following_url":"https://api.github.com/users/gruns/following{/other_user}","gists_url":"https://api.github.com/users/gruns/gists{/gist_id}","starred_url":"https://api.github.com/users/gruns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gruns/subscriptions","organizations_url":"https://api.github.com/users/gruns/orgs","repos_url":"https://api.github.com/users/gruns/repos","events_url":"https://api.github.com/users/gruns/events{/privacy}","received_events_url":"https://api.github.com/users/gruns/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T03:44:24Z","updated_at":"2016-06-29T03:44:24Z","body":"This bug is fixed in furl v0.5.\r\n\r\n```python\r\n>>> import furl\r\n>>> furl.__version__\r\n'0.5'\r\n>>> f = furl.furl(u'/Assassin™-Harrows-80%-Tungsten-Soft-Tip-Darts-568-HDT1007.html')\r\n>>> f.url\r\n'/Assassin%E2%84%A2-Harrows-80%25-Tungsten-Soft-Tip-Darts-568-HDT1007.html'\r\n```\r\n\r\nUpdate with\r\n\r\n```\r\npip install --upgrade furl\r\n```\r\n\r\nThank you for bringing this issue to my attention Lawrence . Don't hesitate to\r\nlet me know if there's anything else I can do for you.\r\n\r\n"}}
{"actor":{"display_login":"gruns"}}