diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index d00ce0ceaa..7ab2b180a2 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -185,6 +185,9 @@ class LoncapaProblem(object): self.problem_text = problem_text # parse problem XML file into an element tree + if isinstance(problem_text, six.text_type): + # etree chokes on Unicode XML with an encoding declaration + problem_text = problem_text.encode('utf-8') self.tree = etree.XML(problem_text) self.make_xml_compatible(self.tree)