From f58de2a66865df1bc226dbdf0c9a57ade3a17045 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 11:49:58 +0000 Subject: Make the hook mechanism support utf-8 branch names Fixes https://pagure.io/fedora-infrastructure/issue/7229 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/__init__.py b/pagure/hooks/__init__.py index c43db65..380b2bc 100644 --- a/pagure/hooks/__init__.py +++ b/pagure/hooks/__init__.py @@ -480,10 +480,14 @@ def extract_changes(from_stdin): changes = {} if from_stdin: for line in sys.stdin: - (oldrev, newrev, refname) = line.strip().split(" ", 2) + (oldrev, newrev, refname) = str(line).strip().split(str(" "), 2) + if six.PY2: + refname = refname.decode("utf-8") changes[refname] = (oldrev, newrev) else: (refname, oldrev, newrev) = sys.argv[1:] + if six.PY2: + refname = refname.decode("utf-8") changes[refname] = (oldrev, newrev) return changes