[Patches] [ python-Patches-471975 ] xmlrpclib failure

noreply@sourceforge.net noreply@sourceforge.net
Wed, 17 Oct 2001 05:35:07 -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: Closed
>Resolution: Fixed
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)



----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-10-17 05:35

Message:
Logged In: YES 
user_id=21627

The patch in #465298 was indeed not applied as-is, however,
a simplified version of this patch was checked in as
xmlrpclib.py 1.8, as my comment from 2001-09-30 22:17
indicates; /F then has revised this code once more in 1.10.

So this has been already fixed, sorry for the duplication of
work.

When providing patches, please always produce context (-c)
or unified (-u) diffs; that makes it easier to integrate the
patch even if the file has been changed (xmlrpclib has seen
a number of changes since 2.2a4).



----------------------------------------------------------------------

Comment By: James Rucker (jamesrucker)
Date: 2001-10-16 23:42

Message:
Logged In: YES 
user_id=351540

I just noticed misa's patch #465298.  Looks like it was not 
used and the issue closed; forgive me if I'm misreading.  
In any case, I just wanted to point out my oversight before 
someone else did.  Presuming that the issue still doesn't 
have a suitable fix, I'll leave the issue open.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=471975&group_id=5470