From: Ian Weller Date: Sun, 14 Mar 2010 17:56:04 +0000 (-0500) Subject: Fix unicode errors on commit X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/0975deb337c03e986718bf2cbbb54377e2e67882?ds=sidebyside Fix unicode errors on commit --- diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 92a852c..4b4d3e5 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -221,6 +221,7 @@ class CommitCommand(CommandBase): # FIXME use basetimestamp and starttimestamp filename = os.path.join(self.metadir.root, file) text = codecs.open(filename, 'r', 'utf-8').read() + text = text.encode('utf-8') if text[-1] == '\n': text = text[:-1] md5 = hashlib.md5() @@ -244,7 +245,6 @@ class CommitCommand(CommandBase): 'ids|flags|timestamp|user|comment|content', } response = self.api.call(data)['query']['pages'] - print response self.metadir.pages_add_rv(int(pageid), response[pageid]['revisions'][0]) else: