[Pkg-zope-developers] Bug#305854: zope loads modules from /usr/share and gets confused

martin f krafft martin f krafft <madduck@debian.org>, 305854@bugs.debian.org
Fri, 22 Apr 2005 16:28:13 +0200


--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: zope2.7
Version: 2.7.5-1
Severity: important

I cannot figure out just why Zope is trying to load modules from
/usr/share, and it only seems to happen when I try to run test
suites:

gaia:/home/zope/ailab.ch# ./bin/zopectl test -T -vv --dir Products/CMFPlone=
=20
Running tests via: /usr/bin/python2.3 /usr/lib/zope2.7/bin/test.py -v --con=
fig-file /etc/zope2.7/ailab.ch/zope.conf --libdir Products -T -vv --dir Pro=
ducts/CMFPlone
Running unit tests at level 1
Running unit tests from /home/zope/ailab.ch/Products/CMFPlone
Parsing /etc/zope2.7/ailab.ch/zope.conf
No module named cPersistence
['/home/zope/ailab.ch/Products', '/usr/share/zope2.7/lib/python', '/usr/sha=
re/zope2.7/bin', '/usr/lib/zope2.7/lib/python', '/usr/lib/python23.zip', '/=
usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/l=
ib-tk', '/usr/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-pa=
ckages', '/usr/lib/python2.3/site-packages', '/usr/lib/python2.3/site-packa=
ges/PIL', '/usr/lib/site-python']
Traceback (most recent call last):
  File "/usr/lib/zope2.7/bin/test.py", line 918, in ?
    process_args()
  File "/usr/lib/zope2.7/bin/test.py", line 904, in process_args
    globals=3Dglobals(), locals=3Dvars())
  File "/usr/lib/python2.3/trace.py", line 458, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in ?
  File "/usr/lib/zope2.7/bin/test.py", line 663, in main
    Zope.configure(config_file)
  File "/usr/share/zope2.7/lib/python/Zope/Startup/run.py", line 27, in con=
figure
    opts =3D _setconfig(configfile)
  File "/usr/share/zope2.7/lib/python/Zope/Startup/run.py", line 40, in _se=
tconfig
    opts.realize(doc=3D"Sorry, no option docs yet.", raise_getopt_errs=3D0)
  File "/usr/share/zope2.7/lib/python/zdaemon/zdoptions.py", line 271, in r=
ealize
    self.load_schema()
  File "/usr/share/zope2.7/lib/python/zdaemon/zdoptions.py", line 312, in l=
oad_schema
    self.schema =3D ZConfig.loadSchema(self.schemafile)
  File "/usr/share/zope2.7/lib/python/ZConfig/loader.py", line 37, in loadS=
chema
    return SchemaLoader().loadURL(url)
  File "/usr/share/zope2.7/lib/python/ZConfig/loader.py", line 71, in loadU=
RL
    return self.loadResource(r)
  File "/usr/share/zope2.7/lib/python/ZConfig/loader.py", line 137, in load=
Resource
    schema =3D ZConfig.schema.parseResource(resource, self)
  File "/usr/share/zope2.7/lib/python/ZConfig/schema.py", line 43, in parse=
Resource
    xml.sax.parse(resource.file, parser)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/__init__.py", line 31=
, in parse
    parser.parse(filename_or_stream)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line=
 109, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/xmlreader.py", line 1=
23, in parse
    self.feed(buffer)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line=
 216, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line=
 312, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/usr/share/zope2.7/lib/python/ZConfig/schema.py", line 115, in star=
tElement
    getattr(self, "start_" + name)(attrs)
  File "/usr/share/zope2.7/lib/python/ZConfig/schema.py", line 469, in star=
t_schema
    keytype, valuetype, datatype =3D self.get_sect_typeinfo(attrs)
  File "/usr/share/zope2.7/lib/python/ZConfig/schema.py", line 207, in get_=
sect_typeinfo
    datatype =3D self.get_datatype(attrs, "datatype", "null")
  File "/usr/share/zope2.7/lib/python/ZConfig/schema.py", line 200, in get_=
datatype
    return self._registry.get(dtname)
  File "/usr/share/zope2.7/lib/python/ZConfig/datatypes.py", line 298, in g=
et
    t =3D self.search(name)
  File "/usr/share/zope2.7/lib/python/ZConfig/datatypes.py", line 323, in s=
earch
    package =3D __import__(n, g, g, component)
  File "/usr/share/zope2.7/lib/python/Zope/Startup/datatypes.py", line 18, =
in ?
    from ZODB.config import ZODBDatabase
  File "/usr/share/zope2.7/lib/python/ZODB/__init__.py", line 19, in ?
    import cPersistence, Persistence
ImportError: No module named cPersistence

There is no cPersistence module in /usr/share because it's a .so and
thus not tree-linked, but rather installed to /usr/lib directly.

Other than this problem, zope2.7 seems to work fine. I am still
flagging this bug important because it theoretically applies to
every case when a .so is loaded.

Nevertheless, I think the real bug is that the test method somehow
causes /usr/share to be added to the search path. It's not in my
zope.conf and I cannot figure out where it is being added.

This sucks.

I am going to investigate and will report. This bug report needs to
go public now though.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (600, 'testing'), (98, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-wing
Locale: LANG=3Den_GB, LC_CTYPE=3Den_GB.UTF-8 (charmap=3DUTF-8)

Versions of packages zope2.7 depends on:
ii  adduser                     3.63         Add and remove users and groups
ii  debconf                     1.4.42       Debian configuration managemen=
t sy
ii  dpkg                        1.10.27      Package maintenance system for=
 Deb
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared librarie=
s an
ii  python2.3                   2.3.5-2      An interactive high-level obje=
ct-o
ii  python2.3-xml               0.8.4-1      XML tools for Python (2.3.x)

-- debconf information excluded

--=20
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, user, and author
`. `'`
  `-  Debian - when you have better things to do than fixing a system
=20
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!
=20
eleventh law of acoustics:
  in a minimum-phase system there is an inextricable link between
  frequency response, phase response and transient response, as they
  are all merely transforms of one another. this combined with
  minimalization of open-loop errors in output amplifiers and correct
  compensation for non-linear passive crossover network loading can
  lead to a significant decrease in system resolution lost. however,
  of course, this all means jack when you listen to pink floyd.

--qMm9M+Fa2AknHoGS
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCaQn9IgvIgzMMSnURAqFqAJ96xyAjFgYK+Q9NCB9gvOmH1Mh+xwCfebm+
MMd54wLGXdEDU1Xj8YfrAPg=
=5Xen
-----END PGP SIGNATURE-----

--qMm9M+Fa2AknHoGS--