From: martin f. krafft Date: Fri, 5 Feb 2010 03:33:25 +0000 (+0100) Subject: Decode patch from UTF-8 while parsing from stdin X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e;p=patchwork 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 Signed-off-by: Jeremy Kerr --- 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: