Exceptions do not always have __module__ attribute

Bug #1244738 reported by J. Milner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Appy
Fix Released
Medium
Gaëtan Delannay

Bug Description

Hello,

Some Exceptions are not passed through to the output document because they do not have __module__ attributes. For example:
* In my template, I write a comment with the statement do text for thneed in student.thneeds;
* student has no attribute thneeds;
* When trying to render the report, the error I see is:
File "/opt/django-sis/appy/pod/actions.py" in getExceptionLine
  58. return '%s.%s: %s' % (e.__module__, e.__class__.__name__, str(e))

Exception Type: AttributeError at /sis/reports/
Exception Value: 'exceptions.AttributeError' object has no attribute '__module__'

* Looking at the local variable e in the stack trace, I can see that the real exception is:
AttributeError("'Student' object has no attribute 'thneeds'",)

* However, e.__module__ doesn't exist, so getExceptionLine() fails, and instead of passing the true exception into the output document as a comment, generation stops completely.

https://bugs.launchpad.net/appy/+bug/1213724 is a related bug in that AttributeError is being raised instead of noting the SyntaxError in the output document.

Kind regards,

John

Changed in appy:
milestone: none → 0.9.1
assignee: nobody → Gaëtan Delannay (gaetan-delannay)
importance: Undecided → Medium
status: New → Fix Committed
Changed in appy:
milestone: 0.9.1 → 0.9.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.