# HG changeset patch # User Goffi # Date 1457554875 -3600 # Node ID 12e0bfdfe9c6e892630abd85fab1c29e659642d8 # Parent 763da94ba28b0e14517e96c43a0d819240ab0e6e blog: fixed forgotten encode with urllib.quote diff -r 763da94ba28b -r 12e0bfdfe9c6 src/server/blog.py --- a/src/server/blog.py Wed Mar 09 20:40:27 2016 +0100 +++ b/src/server/blog.py Wed Mar 09 21:21:15 2016 +0100 @@ -430,7 +430,7 @@ link_blog_elt['type'] = u'application/xmpp+xml' link_blog_elt['href'] = blog_xmpp_uri - feed_elt.addElement('id', content=urllib.quote(blog_xmpp_uri)) + feed_elt.addElement('id', content=urllib.quote(blog_xmpp_uri.encode('utf-8'))) updated_unix = max([float(item['updated']) for item in items]) updated_dt = datetime.fromtimestamp(updated_unix) feed_elt.addElement(u'updated', u'{}Z'.format(updated_dt.isoformat("T"))) @@ -450,7 +450,7 @@ http_link_elt = entry_elt.addElement(u'link') http_link_elt['rel'] = u'alternate' http_link_elt['type'] = u'text/html' - http_link_elt['href'] = u'{base}/{quoted_id}'.format(base=base_blog_url, quoted_id=urllib.quote(item['id'])) + http_link_elt['href'] = u'{base}/{quoted_id}'.format(base=base_blog_url, quoted_id=urllib.quote(item['id'].encode('utf-8'))) # XMPP link xmpp_link_elt = entry_elt.addElement(u'link') xmpp_link_elt['rel'] = u'alternate' @@ -574,7 +574,7 @@ # FIXME: that's really not a good way to get item id # this must be changed after static blog refactorisation item_id = items[0][0]['id'] - xmpp_uri+=u";item={}".format(urllib.quote(item_id)) + xmpp_uri+=u";item={}".format(urllib.quote(item_id.encode('utf-8'))) data = {'url_base': base_url, 'xmpp_uri': xmpp_uri,