Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #1803
  • Loading branch information
ralsina committed Jun 10, 2015
1 parent 8266fcd commit db77b8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -11,6 +11,7 @@ Features
Bugfixes
--------

* IDNA mixing unicode/bytes in python 3 (Issue #1803)
* Cleaner splitting of metadata in onefile posts (Issue #973)
* It's markdown extra, not extras (Issue #1799)

Expand Down
8 changes: 7 additions & 1 deletion nikola/nikola.py
Expand Up @@ -1026,7 +1026,13 @@ def url_replacer(self, src, dst, lang=None, url_type=None):
# python 3: already unicode
pass
nl = nl.encode('idna')

if isinstance(nl, utils.bytes_str):
nl = nl.decode('latin-1') # so idna stays unchanged
print(repr((dst_url.scheme,
nl,
dst_url.path,
dst_url.query,
dst_url.fragment)))
dst = urlunsplit((dst_url.scheme,
nl,
dst_url.path,
Expand Down

0 comments on commit db77b8e

Please sign in to comment.