Skip to content

Commit

Permalink
Ignore sliced multibyte characters when reading metadata for sitemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
da2x committed Aug 9, 2015
1 parent 0860058 commit 4d859e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -12,6 +12,7 @@ Features
Bugfixes
--------

* Ignore sliced multibyte characters when reading metadata for sitemaps
* Handle folders without trailing slashes in nikola auto (Issue #1933)
* Set a base element to aid relative URL resolution, stripped on-the-fly
when using the auto or serve command to view site locally. (Issue #1922)
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/sitemap/__init__.py
Expand Up @@ -188,7 +188,7 @@ def scan_locs():
b'<meta content=none name=robots',
b'<meta name=robots content=noindex',
b'<meta name=robots content=none']
lowquothead = filehead.lower().decode('utf-8').replace('"', '').encode('utf-8')
lowquothead = filehead.lower().decode('utf-8', 'ignore').replace('"', '').encode('utf-8')
if any([robot_directive in lowquothead for robot_directive in robots_directives]):
continue

Expand Down

2 comments on commit 4d859e0

@muxuezi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's ok, there is no error of sitemap any more

@bnmnetp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that change fixes the problem for me as well.

Please sign in to comment.