From eb49c80e82e73901471c55fcaf0262346d4033c2 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 31 Dec 2014 15:02:26 -0600 Subject: [PATCH] Fix YAML+Jinja Unicode handling --- course/content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/course/content.py b/course/content.py index 6536593b..2feb5f73 100644 --- a/course/content.py +++ b/course/content.py @@ -28,6 +28,7 @@ from django.conf import settings import re import datetime +import six from django.utils.timezone import now from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured @@ -119,6 +120,9 @@ JINJA_YAML_RE = re.compile( def expand_yaml_macros(repo, commit_sha, yaml_str): + if isinstance(yaml_str, six.binary_type): + yaml_str = yaml_str.decode("utf-8") + def compute_replacement(match): jinja_src = match.group(1) -- GitLab