changeset 2328:f9adda22a2e1

tools(common/uri): fixed encoding in buildXMPPUri
author Goffi <goffi@goffi.org>
date Thu, 13 Jul 2017 21:23:36 +0200
parents dad500e7ae50
children f15b428852a0
files src/tools/common/uri.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/tools/common/uri.py	Thu Jul 13 21:13:35 2017 +0200
+++ b/src/tools/common/uri.py	Thu Jul 13 21:23:36 2017 +0200
@@ -75,13 +75,13 @@
 
 def addPairs(uri, pairs):
     for k,v in pairs.iteritems():
-        uri.append(u';' + urllib.quote_plus(k) + u'=' + urllib.quote_plus(v))
+        uri.append(u';' + urllib.quote_plus(k.encode('utf-8')) + u'=' + urllib.quote_plus(v.encode('utf-8')))
 
 def buildXMPPUri(type_, **kwargs):
     uri = [u'xmpp:']
     subtype = kwargs.pop('subtype', None)
     path = kwargs.pop('path')
-    uri.append(urllib.quote_plus(path).replace(u'%40', '@'))
+    uri.append(urllib.quote_plus(path.encode('utf-8')).replace(u'%40', '@'))
 
     if type_ == u'pubsub':
         if subtype == 'microblog' and not kwargs.get('node'):