Skip to content

Commit 82b1545

Browse files
committed
fix #45 for py3k
1 parent 00ec365 commit 82b1545

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

textile/core.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,16 @@ def encode_url(self, url):
942942
quote(netloc_parsed['password']))
943943
host = netloc_parsed['host']
944944
port = netloc_parsed['port'] and netloc_parsed['port']
945-
path = '/'.join( # could be encoded slashes!
946-
quote(unquote(pce.encode('utf8')), b'')
947-
for pce in parsed.path.split('/')
948-
)
945+
if six.PY2:
946+
path = '/'.join( # could be encoded slashes!
947+
quote(unquote(pce.encode('utf8')), b'')
948+
for pce in parsed.path.split('/')
949+
)
950+
else:
951+
path = '/'.join( # could be encoded slashes!
952+
quote(unquote(pce), b'')
953+
for pce in parsed.path.split('/')
954+
)
949955
fragment = quote(unquote(parsed.fragment))
950956

951957
# put it back together

0 commit comments

Comments
 (0)