summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormartin f. krafft <madduck@madduck.net>2010-02-05 04:33:25 +0100
committerJeremy Kerr <jk@ozlabs.org>2010-12-13 08:22:21 +0800
commit7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e (patch)
tree8d898d9dc4b9f926e59a4b1de6ae44d70e2b76ea /apps
parentad4715cef72910b1310d4b93a2294ace878b0b4a (diff)
downloadpatchwork-7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e.tar.bz2
patchwork-7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e.tar.xz
Decode patch from UTF-8 while parsing from stdin
Patchwork (rightfully) hashes patches using UTF-8: parser.py: def hash_patch(str): […] hash.update(line.encode('utf-8') + '\n') This patch makes sure that it treats the incoming data as UTF-8 as well. Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/parser.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/patchwork/parser.py b/apps/patchwork/parser.py
index 2b5e9a0..24631b7 100644
--- a/apps/patchwork/parser.py
+++ b/apps/patchwork/parser.py
@@ -63,8 +63,7 @@ def parse_patch(text):
lc = (0, 0)
hunk = 0
-
- for line in text.split('\n'):
+ for line in text.decode('utf-8').split('\n'):
line += '\n'
if state == 0: