import cgitb; cgitb.enable()
<type 'exceptions.TypeError'> | Python 2.7.18: /usr/bin/python Tue May 7 20:01:01 2024 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/jdearte/1001010.com/pytest/crash_example_05.py in <module>() |
26 if( __name__ == "__main__"): |
27 try: |
=> 28 main() |
29 print "more unreachable text" |
30 except: |
main = <function main> |
/home/jdearte/1001010.com/pytest/crash_example_05.py in main() |
19 print "<li>Add a little more control, calling cgitb from our exception handler</li>" |
20 print "<li>Nothing will print after this line, the next line contains a div/0!</li>" |
=> 21 print "<li>This will crash: 1/0=%d </li>" % 1/0 |
22 print "</ul>" |
23 print "unreachable text" |
<type 'exceptions.TypeError'>: unsupported operand type(s) for /: 'str' and 'int'
args =
("unsupported operand type(s) for /: 'str' and 'int'",)
message =
"unsupported operand type(s) for /: 'str' and 'int'"