[XML-SIG] Pyexpat error handling

Paul Prescod paul@prescod.net
Mon, 07 Feb 2000 14:54:58 -0600


I'd like to improve the error handling in one case but am not sure how.

>>> from pyexpat import ParserCreate
>>> p=ParserCreate()
>>> p.StartElementHandler=lambda x:x
>>> p.ParseFile( open( "../hamlet.xml" ) )
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: too many arguments; expected 1, got 2

You see how it looks like it was the ParseFile that had too many
arguments but really it was the call to the callback. I'm not sure of
the best way to make this more clear. Perhaps add a bogus traceback
entry???

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
"If I say something, yet it does not fill you with the immediate
burning desire to voluntarily show it to everyone you know, well then,
it's probably not all that important."
    - http://www.bespoke.org/viridian/