From 1e0475c10bc2657bb59f5153f19b3d43f7d97fd5 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Sat, 2 Jun 2012 10:00:41 -0400
Subject: [PATCH] minor change to capa_module: fp needs name when using
stringio for error
---
djangoapps/courseware/modules/capa_module.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/djangoapps/courseware/modules/capa_module.py b/djangoapps/courseware/modules/capa_module.py
index caee3a0cd1..54cb257440 100644
--- a/djangoapps/courseware/modules/capa_module.py
+++ b/djangoapps/courseware/modules/capa_module.py
@@ -206,6 +206,7 @@ class Module(XModule):
if self.DEBUG:
# create a dummy problem instead of failing
fp = StringIO.StringIO('Problem file %s is missing' % self.filename)
+ fp.name = "StringIO"
else:
raise Exception,err
try:
@@ -218,6 +219,7 @@ class Module(XModule):
msg += '%s
' % traceback.format_exc().replace('<','<')
# create a dummy problem with error message instead of failing
fp = StringIO.StringIO('Problem file %s has an error:%s' % (self.filename,msg))
+ fp.name = "StringIO"
self.lcp=LoncapaProblem(fp, self.item_id, state, seed = seed, system=self.system)
else:
raise Exception,err