From 12a23efbbb5dc325521bae5704c4b3fc71938534 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Thu, 14 May 2015 13:21:18 -0300 Subject: [PATCH] fix unicode thingies --- nikola/plugins/task/posts.py | 2 +- nikola/post.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nikola/plugins/task/posts.py b/nikola/plugins/task/posts.py index 8fb325b0e5..7043f36995 100644 --- a/nikola/plugins/task/posts.py +++ b/nikola/plugins/task/posts.py @@ -66,7 +66,7 @@ def tl_ch(): 'basename': self.name, 'name': 'timeline_changes', 'actions': [tl_ch], - 'uptodate': [utils.config_changed(str(kw['timeline']))], + 'uptodate': [utils.config_changed({1: kw['timeline']})], } for lang in kw["translations"]: diff --git a/nikola/post.py b/nikola/post.py index 515ccf35cc..108348d733 100644 --- a/nikola/post.py +++ b/nikola/post.py @@ -234,8 +234,8 @@ def __repr__(self): # Calculate a hash that represents most data about the post m = hashlib.md5() # source_path modification date (to avoid reading it) - m.update(repr(os.stat(self.source_path).st_mtime)) - m.update(json.dumps(self.meta, cls=utils.CustomEncoder, sort_keys=True)) + m.update(utils.unicode_str(os.stat(self.source_path).st_mtime).encode('utf-8')) + m.update(utils.unicode_str(json.dumps(self.meta, cls=utils.CustomEncoder, sort_keys=True)).encode('utf-8')) return ''.format(self.source_path, m.hexdigest()) def _has_pretty_url(self, lang):