[XML-SIG] [Bug #126275] pyexpat.c doesn't match docs or SAX parser

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 19 Dec 2000 11:05:36 +0100


> Hmm.  So what's right?  The C code or the SAX driver and docs?

My guess is that this has nothing to do with Parse(), the function
works correctly. Instead, the problem is that pyexpat invokes a
callback on the content handler, and *that* call has problems with the
number of arguments. Most likely, it's a call to characters, which
occurs frequently when a DocumentHandler is used in a place where a
ContentHandler is expected (i.e. in SAX2).

The straight-forward solution is to have expat call a Python function
with the right number of arguments, and to have that function call the
content handler. Unfortunately, that will add another Python function
call for every characters event, even though in every working
application the argument number mismatch will never be a problem.

So somehow pyexpat should put itself into the traceback. I'm not sure
how this would be done best, though - we can't give reasonable line
number, for example.

Contributions are welcome.

Regards,
Martin