[reportlab-users] Re: The upcoming Reportlab 1.18 release and patches.

David Abrahams reportlab-users@reportlab.com
Tue, 08 Jul 2003 19:23:30 -0400


Robin Becker <robin@reportlab.com> writes:

> In article <uznjoslxt.fsf@boost-consulting.com>, David Abrahams <dave@boost-
> consulting.com> writes
>>Robin Becker <robin@reportlab.com> writes:
>>
>>>>Ignore this if it's too obvious:
>>>>is the rparsexml.parsexmlSimple() issue already fixed? I mean the one
>>>>where parsexml0() returns a two-members tuple instead of one with four
>>>>members?
>>>>
>>>>Igor
>>> Can you give an example, I know there are problems with parsexml0, but I
>>> don't use it at all.
>>
>>It's too obvious a bug for examples; just look at the source code and
>>search for 'return'.
>>
> I must be pretty stupid then, I need an example or tell me which of the returns 
>
> I see these in parsexml0
>
>
> 177:                return (NameString, AttDict, ContentList, ExtraStuff)
> 214:            return (None, endcomment+1) # shortcut exit
> 373:    return (t, cursor)
>
> so I see one 4 and two 2 element returns. Now although that looks
> pretty obviously wrong

Good, that's the problem.  I've thrown valid XML at reportlab and had
it choke on its own 4-element return from parsexml0 when it gets
assigned in reportlab.lib.rparsexml.parsexmlSimple.

> I also see that we have a recursive call to parsexml0 which expects
> a two element return so I believe the problem is slightly more
> complex than you seem to imply.

I think the problem is much simpler than you're making it out to be:
even parsexml0 expects a 2-element tuple when it calls itself
recursively as you can plainly see from looking at the one recursive
call.  Isn't this self-evidently a bug?

> Of course if you know the answer couldn't you just say what it is?

I think the OP pretty much spelled things out.  How can I possibly
make it any clearer?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com