[Zope] unable to create a SAX parser under Linux
Benjamin Buffereau
benjamin.buffereau@enst-bretagne.fr
Mon, 25 Mar 2002 15:13:12 +0100
I have a problem with the Expat parser (which is the default XML SAX parser)
*specific to the Linux distribution of Zope* (everything works well under
Windows). It seems that contrary to the Windows distribution, the Linux
distribution doesn't include Expat.
I downloaded Zope-2.5.0-linux2-x86.tgz and followed the installation procedure.
I created the following "useExpat2.py" external method:
import sys
from xml.sax import make_parser
def useExpat2():
make_parser()
return "Expat parser created"
Then I called this external method from a DMTL method called "foo": <dtml-var
useExpat2>
And I get the following error:
Traceback (innermost last):
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
150, in publish_module
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
114, in publish
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/Zope/__init__.py, line 158,
in zpublisher_exception_hook
(Object: essais)
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
98, in publish
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/mapply.py, line
88, in mapply
(Object: foo)
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
39, in call_object
(Object: foo)
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 127,
in __call__
(Object: foo)
File
/usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line
473, in __call__
(Object: foo)
File
/usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 202, in __call__
(Object: useExpat2)
(Info: ((), {}, None))
File /usr/LOCAL/Zope-2.5.0-linux2-x86/Extensions/useExpat2.py, line 4, in
useExpat2
File /usr/LOCAL/Zope-2.5.0-linux2-x86/lib/python2.1/xml/sax/__init__.py, line
88, in make_parser
SAXReaderNotAvailable: (see above)
Do you have the same problem? Anyone has a solution? Any help would be
appreciated.
Thanks,
Benjamin.
PS: there is the same problem concerning Windows vs. Linux distribution of
python 2.2: expat is included in the Windows version, not the Linux one. I
managed to compile my own python2.2 under Linux including the Expat module, but
I failed to do the same with Zope.