[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-xml-sig
Subject:    [XML-SIG] PyXML parser problem
From:       bob () robisonranch ! net (Bob Robison)
Date:       2004-03-04 23:16:11
Message-ID: 20040304221600.40d2c2c9.bob () robisonranch ! net
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic