From f4280377c580a94cfaaa626d606eaac29a9283e6 Mon Sep 17 00:00:00 2001
From: Tim Babych
Date: Wed, 18 Jun 2014 18:30:59 +0300
Subject: [PATCH] Do not print exception message below stacktrace
---
common/lib/capa/capa/inputtypes.py | 2 +-
common/lib/xmodule/xmodule/capa_base.py | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py
index 6e88882be0..066f6d46a1 100644
--- a/common/lib/capa/capa/inputtypes.py
+++ b/common/lib/capa/capa/inputtypes.py
@@ -221,7 +221,7 @@ class InputTypeBase(object):
self.status = state.get('status', 'unanswered')
try:
- # Pre-parse and propcess all the declared requirements.
+ # Pre-parse and process all the declared requirements.
self.process_requirements()
# Call subclass "constructor" -- means they don't have to worry about calling
diff --git a/common/lib/xmodule/xmodule/capa_base.py b/common/lib/xmodule/xmodule/capa_base.py
index 6a95f571ab..9b0ab2221d 100644
--- a/common/lib/xmodule/xmodule/capa_base.py
+++ b/common/lib/xmodule/xmodule/capa_base.py
@@ -249,7 +249,11 @@ class CapaMixin(CapaFields):
# e.g. in the CMS
msg = u'{msg}
'.format(msg=cgi.escape(msg))
msg += u'{tb}
'.format(
- tb=cgi.escape(traceback.format_exc()))
+ # just the traceback, no message - it is already present above
+ tb=cgi.escape(
+ u''.join(['Traceback (most recent call last):\n'] +
+ traceback.format_tb(sys.exc_info()[2])))
+ )
# create a dummy problem with error message instead of failing
problem_text = (u''
u'Problem {url} has an error:{msg}'.format(