[omniORB] pickling user exceptions

Luke Deller ldeller at iress.com.au
Tue Apr 6 15:01:26 BST 2010


Hi,

We encountered a problem serializing CORBA user exceptions using the
cPickle or pickle modules included with the Python standard library.

The problem is due to the __reduce__ method inherited from BaseException
(Python 2.5+) which assumes that the constructor for subclasses of
BaseException may be called with no arguments.  This is not true for the
exception classes generated by omniIDL.

See attached:
- a simple example of the issue: pickletest.py and pickletest.idl
- a patch to fix the issue: omniORBpy-pickle-exceptions.patch

For reference:
- Python documentation for object.__reduce__:
    http://docs.python.org/library/pickle.html#object.__reduce__
- A thread on the python mailing list regarding a corresponding issue:
    http://mail.python.org/pipermail/python-list/2009-December/1228716.html

Regards,
Luke.

**********************************************************************************************
Important Note
This email (including any attachments) contains information which is confidential and may be subject to legal privilege.  If you are not the intended recipient you must not use, distribute or copy this email.  If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Market Technology Limited.

It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system.
IRESS Market Technology Limited does not warrant that the information is free of a virus or any other defect or error.
**********************************************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pickletest.idl
Type: application/octet-stream
Size: 87 bytes
Desc: pickletest.idl
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100406/a3437532/pickletest.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pickletest.py
Type: application/octet-stream
Size: 222 bytes
Desc: pickletest.py
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100406/a3437532/pickletest-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORBpy-pickle-exceptions.patch
Type: application/octet-stream
Size: 395 bytes
Desc: omniORBpy-pickle-exceptions.patch
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100406/a3437532/omniORBpy-pickle-exceptions.obj


More information about the omniORB-list mailing list