diff --git a/common/lib/xmodule/xmodule/capa_base.py b/common/lib/xmodule/xmodule/capa_base.py index 8729ac038a..a27d9b4fb4 100644 --- a/common/lib/xmodule/xmodule/capa_base.py +++ b/common/lib/xmodule/xmodule/capa_base.py @@ -554,7 +554,7 @@ class CapaMixin(ScorableXBlockMixin, CapaFields): url=cgi.escape(text_type(self.location))) ) msg += u'
Error:
{msg}'.format(msg=cgi.escape(text_type(err)))
- msg += u'{tb}'.format(tb=cgi.escape(traceback.format_exc()))
+ msg += u'{tb}'.format(tb=traceback.format_exc())
html = msg
else:
@@ -1238,17 +1238,17 @@ class CapaMixin(ScorableXBlockMixin, CapaFields):
# the full exception, including traceback,
# in the response
if self.runtime.user_is_staff:
- msg = u"Staff debug info: {tb}".format(tb=cgi.escape(traceback.format_exc()))
+ msg = u"Staff debug info: {tb}".format(tb=traceback.format_exc())
# Otherwise, display just an error message,
# without a stack trace
else:
- escaped_message = cgi.escape(inst.args[0])
+ full_error = inst.args[0]
try:
# only return the error value of the exception
- msg = escaped_message.split("\\n")[-2].split(": ", 1)[1]
+ msg = full_error.split("\\n")[-2].split(": ", 1)[1]
except IndexError:
- msg = escaped_message
+ msg = full_error
return {'success': msg}
diff --git a/common/lib/xmodule/xmodule/tests/test_capa_module.py b/common/lib/xmodule/xmodule/tests/test_capa_module.py
index d5019a57cc..affa37ff35 100644
--- a/common/lib/xmodule/xmodule/tests/test_capa_module.py
+++ b/common/lib/xmodule/xmodule/tests/test_capa_module.py
@@ -867,7 +867,7 @@ class CapaModuleTest(unittest.TestCase):
# Ensure that the user is NOT staff
module.system.user_is_staff = False
- # Simulate a codejail exception 'Exception: test error'
+ # Simulate a codejail exception "Exception: Couldn't execute jailed code"
with patch('capa.capa_problem.LoncapaProblem.grade_answers') as mock_grade:
try:
raise ResponseError(
@@ -876,14 +876,14 @@ class CapaModuleTest(unittest.TestCase):
' File "jailed_code", line 15, in