[XML-SIG] PyXML 0.8.3 problem on windows...

Radovan Chytracek Radovan.Chytracek at cern.ch
Sat Sep 27 13:48:16 EDT 2003


         I have just recently installed PyXML 0.8.3 on my windows where
I have Python 2.2.3 and 2.3 in parallel. I have used for each version
the corresponding PyXML binary installer. I have observed a problem
which did not happen before, as I was using default SAX parser coming
with Python distribution which I think is non-validating one.

I plan to use SAX2 features so I installed PyXML which claims it has
supports SAX and even XML validation in xmlproc parser. Good.

The problem. In one of my test XML files I have a bogus DTD system id
which is handled in our C++ framework by using EntityResolver.
This seems to make PyXML SAX parser die with the following stack trace:

Traceback (most recent call last):
  File "RlsLoadXml.py", line 52, in ?
    xmldata = RlsLoadXml( dataFile )
  File "RlsLoadXml.py", line 8, in RlsLoadXml
  File "RlsCatalogLoader.py", line 106, in load
    self.docfilter.parse( self.input_file )
  File "C:\Python22\Lib\site-packages\_xmlplus\sax\saxutils.py", line
441, in parse
  File "C:\Python22\Lib\site-packages\_xmlplus\sax\expatreader.py", line
109, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python22\Lib\site-packages\_xmlplus\sax\xmlreader.py", line
123, in parse
  File "C:\Python22\Lib\site-packages\_xmlplus\sax\expatreader.py", line
216, in feed
    self._parser.Parse(data, isFinal)
  File "C:\Python22\Lib\site-packages\_xmlplus\sax\expatreader.py", line
395, in external_entity_ref
    self._source.getSystemId() or
  File "C:\Python22\Lib\site-packages\_xmlplus\sax\saxutils.py", line
507, in prepare_input_source
    if source.getByteStream() is None:
AttributeError: 'NoneType' object has no attribute 'getByteStream'

I don't know what parser gets created by calling xml.sax.make_parser()
call after PyXML is installed by I am sure if it's validating parser it
should report that unknown or invalid DTD system id has been found and
stop parsing with some reasonable error message. This stack trace was of
no use as I had to spent quite some time to figure out what's the

If I uninstall PyXML 0.8.3 from my system all is running OK as I
apparently get back to the non-validating parser which does not care
much about crazy DTD system id.

Anybody else is having  asimilar problem?


More information about the XML-SIG mailing list