[XML-SIG] PyXML parser problem

Bob Robison bob at robisonranch.net
Thu Mar 4 23:16:00 EST 2004


I'm trying to get some existing code running with py2exe 0.5.0 and am having some problems.

I've narrowed things down to a simple test file:

#!/usr/bin/env python
from xml.dom.ext.reader import Sax2
xr=Sax2.Reader()
print "Success"

If I run this with 'python test.py' then I get an Attribute error returned from saxexts.py:

  return drv_module.create_parser()
Attribute Error: 'module' object has no attribute 'create_parser'

If I run python interactively, and then type in the commands above from the prompt, it works fine.   I don't understand what the issues are, but obviously there is something in the environment that is different.

Putting in a few prints in the saxexts.py library, it appears that the parser that is trying to be created is pyexpat -- which fails.  When it works it apparently tries 'xml.sax.drivers2.drv_pyexpat' which seems to work.  I hard-coded to try the specific name mentioned above and then it works running the test.py file.  However, when I try to use py2exe I get a similar problem: The make_parser routine returns:
xml.sax._exceptions.SAXReaderNotAvailable: No parsers found.

Can someone offer some clues about the differences in these environments, and how to possible force the right thing?

I'm using py2exe 0.5.0, Python 2.3.3, and PyXML 0.8.3 on Windows 2000.  The original program (and all of my normal work) is done on Linux, where I've been using Python 2.2.  I haven't tried upgrading the Linux to 2.3 yet.  I would have tried Python 2.2 on windows, but py2exe was wanting the later python.

Help!

bob




More information about the XML-SIG mailing list