changeset 091def8ded1c in modules/web_shortener:default
details: 
https://hg.tryton.org/modules/web_shortener?cmd=changeset;node=091def8ded1c
description:
        Use string to format URL instead of bytes

        Bytes formatting is not supported by Python3.4
diffstat:

 web.py |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (21 lines):

diff -r 75ec131728e3 -r 091def8ded1c web.py
--- a/web.py    Sat Mar 30 18:16:01 2019 +0100
+++ b/web.py    Sat Mar 30 23:52:58 2019 +0100
@@ -39,13 +39,13 @@
         urls = {}
 
         url_parts = {
-            b'database': Base64Converter(None).to_url(
-                Transaction().database.name),
+            'database': Base64Converter(None).to_url(
+                Transaction().database.name).decode('utf-8'),
             }
         for shortened in shortened_urls:
-            url_parts[b'short_id'] = cls._shorten(shortened.id).encode('utf-8')
+            url_parts['short_id'] = cls._shorten(shortened.id)
             urls[shortened.id] = urljoin(
-                URL_BASE, quote(b'/s/%(database)s$%(short_id)s' % url_parts))
+                URL_BASE, quote('/s/%(database)s$%(short_id)s' % url_parts))
         return urls
 
     @classmethod

Reply via email to