[omniORB] Uncaught Python exception in omniORBpy raised by a C extension

Scott Yang syang at xplantechnology.com
Thu Jan 6 11:56:11 GMT 2005


Hi,

Recently I discovered an issue with how omniORBpy handles Python
exceptions raised by another C extension. In my situation, I have
another C extension that raises a proper CORBA exception, imported from
stub .py files generated from omniidl. However, when the exception gets
escalated to omniORBpy, it regards it as an unexpected Python exception,
instead of throwing it as a user exception.

Looking at the source, I found PyErr_Fetch(&etype, &evalue,
&etracekback) has been used to analyse the caught exception. However,
since exceptions raised by extensions do not instantiate, "evalue" would
be NULL and omniORBpy would just treat it as an unexpected Python
exception. The patch attached adds PyErr_NormalizeException() right
after PyErr_Fetch() to defeat the lazy-instantiation of Python
exception. It has no speed penalty if the exception has already been
instantiated (raised inside Python).

Regards,

____________________
Scott Yang <syang at xplantechnology.com>
Xplan Technology Pty Ltd.
Software Architect

-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORBpy-pyexception.patch
Type: application/octet-stream
Size: 2053 bytes
Desc: omniORBpy-pyexception.patch
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20050106/250a8714/omniORBpy-pyexception.obj


More information about the omniORB-list mailing list