From 20671748ca904f9ccaaf1f513ad630dd98a6e472 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 13 Mar 2017 14:48:51 -0400 Subject: [PATCH] Coerce submitted branch name from unicode to bytes. I hit this in prod on the latest 1.3.4 release. --- module_build_service/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module_build_service/views.py b/module_build_service/views.py index 9ea9a31d..6bb9a47d 100644 --- a/module_build_service/views.py +++ b/module_build_service/views.py @@ -133,6 +133,10 @@ class ModuleBuildAPI(MethodView): branch = r["branch"] + # python-modulemd expects this to be bytes, not unicode. + if isinstance(branch, unicode): + branch = branch.encode('utf-8') + validate_optional_params(r) optional_params = {k: v for k, v in r.items() if k != "scmurl" and k != 'branch'} return submit_module_build_from_scm(username, url, branch, allow_local_url=False, optional_params=optional_params)