From patchwork Fri Feb 5 03:33:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin Krafft X-Patchwork-Id: 44606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 88B95B7CD5 for ; Fri, 5 Feb 2010 14:34:54 +1100 (EST) Received: from clegg.madduck.net (clegg.madduck.net [193.242.105.96]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3ACE7B7CE2 for ; Fri, 5 Feb 2010 14:34:53 +1100 (EST) Received: from lotus.madduck.net (lotus.madduck.net [IPv6:2001:1620:2018:2::4d6d:8b55]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lotus.madduck.net", Issuer "CAcert Class 3 Root" (verified OK)) by clegg.madduck.net (postfix) with ESMTPS id 62AA61D409B; Fri, 5 Feb 2010 04:34:43 +0100 (CET) Received: by lotus.madduck.net (postfix, from userid 1000) id CF01932312; Fri, 5 Feb 2010 04:33:27 +0100 (CET) From: "martin f. krafft" To: patchwork@lists.ozlabs.org Subject: [PATCH] Decode patch from UTF-8 while parsing from stdin Date: Fri, 5 Feb 2010 04:33:25 +0100 Message-Id: <1265340805-25653-1-git-send-email-madduck@madduck.net> X-Mailer: git-send-email 1.6.5 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.95.3 at clegg X-Virus-Status: Clean Cc: "martin f. krafft" X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org 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: