[Zope3-dev] Zope 3 needs pyexpat?

Martijn Faassen faassen@vet.uu.nl
Thu, 8 Aug 2002 12:21:42 +0200


Fred L. Drake, Jr. wrote:
> 
> Guido van Rossum writes:
>  > > In any case, should it be bundled as part of a normal Python distribution?
>  > 
>  > AFAIK it already is, with Python 2.2 and later.
> 
> The Expat code is bundled on Windows, but not in the 2.2.x sources.
> This changes with Python 2.3, when Expat is always included.
> 
> For Python 2.2.x, the pyexpat binding is built when the Expat library
> is already installed in a standard location on the build host.
> 
> The easiest and most reliable way to get Expat/pyexpat for Python 2.0
> through 2.2.x is to build and install PyXML 0.8.

Note that there's a bug in test.py; I see from the recent checkin in 
test.py (in the Zope 3 root) that Chris struggled with this as well.

test.py tries to do:

import pyexpat

I however got the impression (from Martin von Loewis I think) that one should
import something from 'xml.parsers' instead as the right way, like:

from xml.parsers import pyexpat

instead.

But I, or to be more exact, the whole expat situation, is rather 
confused. On my debian box:

Python2.1 with PyXML installed:

  from xml.parsers import expat
  from xml.parsers import pyexpat
  import pyexpat

all work

Python2.2 without PyXML:

  from xml.parsers import expat
  import pyexpat

works

but:

  from xml.parsers import pyexpat

does not.

Installing PyXML apparently makes no difference here; I just tried,
no change. Situation is different from the one in Python 2.1 apparently.

PyXML version is 0.7.1 on this box (the debian unstable default).

I think someone reported a bug at the Charleroi sprint involving all this --
the expat situation is hopelessly confusing. I hope Python 2.3 will
document somewhere (at least) the One True Way to import Expat so it'll
all work. Currently the situation involves way way too much magic;
I believe PyXML even does not compile its own expat if it detects one
installed already, or something along those lines, adding further to
the absolute incomprehensibility of all this.

Yes, I've suffered with expat and python enough now to forget about being
pollite -- in my opinion this is a godawful mess.

Regards,

Martijn