[Patches] [ python-Patches-471975 ] xmlrpclib failure
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 16 Oct 2001 23:31:17 -0700
Patches item #471975, was opened at 2001-10-16 23:31
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=471975&group_id=5470
Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: James Rucker (jamesrucker)
Assigned to: Nobody/Anonymous (nobody)
Summary: xmlrpclib failure
Initial Comment:
This bug has been reported earlier (issue #446912),
but the earlier patch provided (as admitted by the
author) introduces major unnecessary overhead and
also, according to the author, may not work.
I've provided a very simple fix (6 additional lines),
which seems to be in line with the design of the
code. From my reading, the source of the problem
looks more like an oversight than a real design hole
or flaw.
The problem again is that objects that appear more
than once in the input to xmlrpclib.Marshaller.dumps()
are thought to be evidence of recursion. The reason
this occurs is because the mechanism that tracks the
occurence of container objects (as it descends the
chain of container objects) neglects to remove from
it's map those objects on the way back up.
The fix is to perform proper cleanup, removing
from 'memo' container objects, which are no longer
part of the context.
With the fix, the following works (it breaks under
existing code):
import xmlrpclib
m = xmlrpclib.Marshaller()
a = ['1']
b = [a,a]
m.dumps(b)
and the following still fails (which is correct
behavior):
a = [1]; a.append(a)
m.dumps(a)
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=471975&group_id=5470