From 7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 5 Feb 2010 04:33:25 +0100 Subject: [PATCH] Decode patch from UTF-8 while parsing from stdin MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- apps/patchwork/parser.py | 3 +-- 1 file changed, 1 insertion(+), 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: -- 2.39.2