Skip to content
Permalink
Browse files

Fixed Python 3 problem caused by calling decode() on str object.

  • Loading branch information
felixfontein committed Jun 29, 2015
1 parent 5781644 commit 7a17f12ec0205f1c1aab5987f2b1568f377b919e
Showing with 5 additions and 1 deletion.
  1. +5 −1 nikola/plugins/command/import_wordpress.py
@@ -169,7 +169,11 @@ def show_info_about_mising_module(modulename):

# Add tag redirects
for tag in self.all_tags:
tag = utils.slugify(tag.decode('utf8'))
# In python 2, path is a str. slug requires a unicode
# object. According to wikipedia, unquoted strings will
# usually be UTF8
tag_str = tag.decode('utf8') if isinstance(tag, utils.bytes_str) else tag
tag = utils.slugify(tag_str)
src_url = '{}tag/{}'.format(self.context['SITE_URL'], tag)
dst_url = self.site.link('tag', tag)
if src_url != dst_url:

0 comments on commit 7a17f12

Please sign in to comment.
You can’t perform that action at this time.