[XML-SIG] Using PyExpat.py

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat, 10 Feb 2001 08:00:33 +0100


> I'm trying to construct a DOM using PyExpat.py. My environment is:
> 
>    Python 1.5.2
>    PyXML 0.6.2
[...]
>         try:
>             reader = PyExpat.Reader()
>             reader._override = None
>             fp = open(filename, 'r')
>             xml_dom_object = reader.fromStream(fp)
>         except Exception, msg:
>             print "Exception caught:", msg
>             return
[...]
> Can anybody tell me what I'm doing wrong?

That's hard to say. First, a number of changes have been made since
0.6.2; I can't reproduce your problem. In any case, I recommend to let
the exception through instead of trying to print it this way: it is
much more informative to get a full traceback, and full information
about the exception.

Regards,
Martin