After some reasonable Google search, I would say that Eclipse is causing the problem and that it is difficult to track. print_exc is a function in the Python trace module. Eclipse may try to show you tracing, losing failures, and using the result in the process.
I think that a reasonable workaround would be to continue working on this script in a tool that does not present you with incomprehensible errors. You may find the actual (correctable) error in the code, or you will find that Eclipse raised a false alarm due to an error in its integration with Python.
If at this point you do not know if there are problems with your code, adding some tests may be useful.
source share