[ python-Bugs-1739842 ] xmlrpclib can no longer marshal Fault objects
SourceForge.net
noreply at sourceforge.net
Tue Jun 19 18:57:20 CEST 2007
Bugs item #1739842, was opened at 2007-06-19 12:57
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1739842&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mike Bonnet (mbonnet)
Assigned to: Nobody/Anonymous (nobody)
Summary: xmlrpclib can no longer marshal Fault objects
Initial Comment:
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1739842&group_id=5470
More information about the Python-bugs-list
mailing list