utils.py: attempted fix for IOError cases in annotateException
authorrgbecker
Fri, 03 Sep 2010 09:39:34 +0000
changeset 3429 faa6425d8806
parent 3428 565efe6cccb1
child 3430 18c044305ff6
utils.py: attempted fix for IOError cases in annotateException
src/reportlab/lib/utils.py
--- a/src/reportlab/lib/utils.py	Fri Sep 03 09:38:52 2010 +0000
+++ b/src/reportlab/lib/utils.py	Fri Sep 03 09:39:34 2010 +0000
@@ -1132,7 +1132,10 @@
                 msg=msg.encode(enc)
             else:
                 msg = str(msg)
-        A[e] += msg
+        if isinstance(v,IOError) and hasattr(v,'strerror'):
+            v.strerror = msg+'\n'+v.strerror
+        else:
+            A[e] += msg
     else:
         A.append(msg)
     v.args = tuple(A)