Skip to content
Permalink
Browse files
Change suggested by Kwpolska.
  • Loading branch information
felixfontein committed Jun 30, 2015
1 parent 3032349 commit 063afb97e366fc4b5d9aa4ab59527f5179afaba4
Showing with 7 additions and 8 deletions.
  1. +7 −8 nikola/plugins/command/import_wordpress.py
@@ -169,10 +169,10 @@ def show_info_about_mising_module(modulename):

# Add tag redirects
for tag in self.all_tags:
# 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
try:
tag_str = tag.decode('utf8')
except AttributeError:
tag_str = tag
tag = utils.slugify(tag_str)
src_url = '{}tag/{}'.format(self.context['SITE_URL'], tag)
dst_url = self.site.link('tag', tag)
@@ -401,11 +401,10 @@ def import_item(self, item, wordpress_namespace, out_folder=None):
parsed = urlparse(link)
path = unquote(parsed.path.strip('/'))

# In python 2, path is a str. slug requires a unicode
# object. According to wikipedia, unquoted strings will
# usually be UTF8
if isinstance(path, utils.bytes_str):
try:
path = path.decode('utf8')
except AttributeError:
pass

# Cut out the base directory.
if path.startswith(self.base_dir.strip('/')):

0 comments on commit 063afb9

Please sign in to comment.