From patchwork Fri Feb 5 03:33:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Decode patch from UTF-8 while parsing from stdin Date: Thu, 04 Feb 2010 17:33:25 -0000 From: Martin Krafft X-Patchwork-Id: 44606 Message-Id: <1265340805-25653-1-git-send-email-madduck@madduck.net> To: patchwork@lists.ozlabs.org Cc: "martin f. krafft" 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: Paul Menzel --- apps/patchwork/parser.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/apps/patchwork/parser.py b/apps/patchwork/parser.py index 16cc308..de81ca7 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: