]> git.ozlabs.org Git - patchwork/commitdiff
parser: decode stdin from utf-8
authorJeremy Kerr <jk@ozlabs.org>
Tue, 10 Aug 2010 03:55:57 +0000 (11:55 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 10 Aug 2010 03:55:57 +0000 (11:55 +0800)
We need to decode stdin from the patch parser as UTF-8, rather than
python assuming ascii.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/parser.py

index 16cc30851e6cc8f38e34cb0e66491cdd84bf347c..2b5e9a093c478756d65ef001cdb59e48eb0af0c5 100644 (file)
@@ -222,7 +222,10 @@ def main(args):
 
     (options, args) = parser.parse_args()
 
-    (patch, comment) = parse_patch(sys.stdin.read())
+    # decode from (assumed) UTF-8
+    content = sys.stdin.read().decode('utf-8')
+
+    (patch, comment) = parse_patch(content)
 
     if options.print_hash and patch:
         print hash_patch(patch).hexdigest()