summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2010-08-10 11:55:57 +0800
committerJeremy Kerr <jk@ozlabs.org>2010-08-10 11:55:57 +0800
commit6f02427039f0a80484f99ebd4595e2ecdfc907bb (patch)
tree9c26385e849c69a8842ba9be023bda129e29d565 /apps
parent112de5d5dc557dc660701a6686dbd47033bff19e (diff)
downloadpatchwork-6f02427039f0a80484f99ebd4595e2ecdfc907bb.tar.bz2
patchwork-6f02427039f0a80484f99ebd4595e2ecdfc907bb.tar.xz
parser: decode stdin from utf-8
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>
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/parser.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/patchwork/parser.py b/apps/patchwork/parser.py
index 16cc308..2b5e9a0 100644
--- a/apps/patchwork/parser.py
+++ b/apps/patchwork/parser.py
@@ -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()