This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mbonnet
Recipients
Date 2007-06-19.16:57:20
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
xmlrpclib attempts to marshal class instances by registering the dump_instance() method as the marshaller for the <type 'instance'> type.  This is how marshalling of Fault objects contained in a tuple (for example, one result in a multicall) is handled.  This worked for Fault objects in python2.4 and earlier because they were old-style classes, and their type was always <type 'instance'>.

In python2.5, Exception (and thus Fault, which inherits from it) moved from an old-style class to a new-style class (inheriting from object).  This means that rather than type(faultinstance) returning <type 'instance'>, it returns <class 'xmlrpclib.Fault'>.  This results in xmlrpclib.Marshaller.__dump() throwing TypeError when it encounters a Fault (or any other new-style class).  This is a regression from python2.4 and earlier, and is particularly problematic for applications that expect to be able to marshal Fault instances.

I've attached a simple patch which allows Fault objects (and all other new-style classes) to be marshalled as structs, the same way Fault objects and old-style classes were in python2.4 and earlier.  This fixes the regression caused by the change in the Exception inheritance hierarchy.
History
Date User Action Args
2007-08-23 14:55:41adminlinkissue1739842 messages
2007-08-23 14:55:41admincreate