From 82b15458faa1efa7d2f8fce16347ad01299199c1 Mon Sep 17 00:00:00 2001 From: Dennis Burke Date: Tue, 4 Jul 2017 11:13:16 -0400 Subject: [PATCH] fix #45 for py3k --- textile/core.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/textile/core.py b/textile/core.py index 6225aed1..28f8db40 100644 --- a/textile/core.py +++ b/textile/core.py @@ -942,10 +942,16 @@ def encode_url(self, url): quote(netloc_parsed['password'])) host = netloc_parsed['host'] port = netloc_parsed['port'] and netloc_parsed['port'] - path = '/'.join( # could be encoded slashes! - quote(unquote(pce.encode('utf8')), b'') - for pce in parsed.path.split('/') - ) + if six.PY2: + path = '/'.join( # could be encoded slashes! + quote(unquote(pce.encode('utf8')), b'') + for pce in parsed.path.split('/') + ) + else: + path = '/'.join( # could be encoded slashes! + quote(unquote(pce), b'') + for pce in parsed.path.split('/') + ) fragment = quote(unquote(parsed.fragment)) # put it back together