# HG changeset patch # User Goffi # Date 1499975126 -7200 # Node ID f15b428852a096fed19f7a38d007a72816375e67 # Parent f9adda22a2e14256b74bbd85e547e2685fef2c84 jp (common): fixed encoding issue in URLs diff -r f9adda22a2e1 -r f15b428852a0 frontends/src/jp/common.py --- a/frontends/src/jp/common.py Thu Jul 13 21:23:36 2017 +0200 +++ b/frontends/src/jp/common.py Thu Jul 13 21:45:26 2017 +0200 @@ -388,7 +388,7 @@ # we have probably an URL, we try to parse it import urlparse url = self.args.item - parsed_url = urlparse.urlsplit(url) + parsed_url = urlparse.urlsplit(url.encode('utf-8')) if parsed_url.scheme.startswith('http'): self.disp(u"{} URL found, trying to find associated xmpp: URI".format(parsed_url.scheme.upper()),1) # HTTP URL, we try to find xmpp: links @@ -418,14 +418,14 @@ self.disp(u"XMPP URI used: {}".format(url),2) # XXX: if we have not xmpp: URI here, we'll take the data as a file path - pubsub_service = parsed_url.path + pubsub_service = parsed_url.path.decode('utf-8') pubsub_data = urlparse.parse_qs(parsed_url.query) try: - pubsub_node = pubsub_data['node'][0] + pubsub_node = pubsub_data['node'][0].decode('utf-8') except KeyError: self.disp(u'No node found in xmpp: URI, can\'t retrieve item', error=True) self.host.quit(1) - pubsub_item = pubsub_data.get('item',[None])[0] + pubsub_item = pubsub_data.get('item',[None])[0].decode('utf-8') if pubsub_item is None and self.args.last_item: command = 'last' elif pubsub_item is not None: