Instances of BaseException and family don't provide __module__?

Steven D'Aprano steve at
Sat Nov 3 06:39:37 CET 2007

On Fri, 02 Nov 2007 19:36:05 -0700, Scott Dial wrote:

> I have started working on a new project using ZSI and perhaps one can
> argue this is a bug in ZSI, but I found it odd. The ZSI dispatcher needs
> to catch all exceptions and pass that over to the client; in doing so,
> it passes along the name of the exception that occurred so that the
> client can know more than just "it failed."

I have no opinion on whether the problem you report is a bug in Python or 
ZSI or not, but I'd suggest that passing along the name of the exception 
is not the right way to go about it.

The right way is to pass along the exception itself:

except Exception, ex:

(Always assuming you want to continue.)

That gives the caller access to as much or as little of the exception as 
it needs.


More information about the Python-list mailing list