[Grok-dev] Pickle namespace clash

Alex Leach albl500 at york.ac.uk
Mon May 21 12:50:52 UTC 2012


Dear Grok Devs,

I've got Grok set up on a number of machines, and have started getting some
errors on my Mac OS X Lion machineŠ
I had Grok set up nicely using mod_wsgi and the Enthought Python
Distribution, so that I could take advantage of Enthought's MKL libraries
with numpy, but a recent buildout has somehow killed it.

The end of the paster error is below.


  File 
"/Users/albl500/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/confi
guration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File 
"/Users/albl500/.buildout/eggs/z3c.autoinclude-0.3.3-py2.7.egg/z3c/autoinclu
de/zcml.py", line 51, in includeDependenciesDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml',
'meta.zcml'])
  File 
"/Users/albl500/.buildout/eggs/z3c.autoinclude-0.3.3-py2.7.egg/z3c/autoinclu
de/dependency.py", line 24, in includableInfo
    module = resolve(dotted_name)
  File 
"/Users/albl500/.buildout/eggs/zope.dottedname-3.4.6-py2.7.egg/zope/dottedna
me/resolve.py", line 32, in resolve
    found = __import__(used)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/bimdp/__init__.py", line 82, in <module>
    from binode import (
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/bimdp/binode.py", line 77, in <module>
    import mdp
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/mdp/__init__.py", line 128, in <module>
    numx_rand, numx_version) = configuration.get_numx()
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/mdp/configuration.py", line 179, in get_numx
    import scipy as numx
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/scipy/__init__.py", line 85, in <module>
    from numpy import oldnumeric
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/numpy/oldnumeric/__init__.py", line 14, in <module>
    from compat import *
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/numpy/oldnumeric/compat.py", line 106, in <module>
    class Unpickler(pickle.Unpickler):
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-package
s/numpy/oldnumeric/compat.py", line 110, in Unpickler
    dispatch = copy.copy(pickle.Unpickler.dispatch)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
"/Library/GrokServer/SoS/server/parts/etc/site.zcml", line 4.2-4.27
    ZopeXMLConfigurationError: File
"/Library/GrokServer/SoS/server/src/SoS/configure.zcml", line 4.2-4.37
    AttributeError: 'builtin_function_or_method' object has no attribute
'dispatch'

I opened up compat.py
(https://github.com/numpy/numpy/blob/master/numpy/oldnumeric/compat.py), and
noticed that the error can be triggered when cPickle is used instead of
pickle. So, I figured an earlier 'import cPickle as pickle' statement could
be the problem. However, I've changed all such lines from my code, and still
get the same error. A grep -r of the egg cache shows that a couple modules
in ZODB3-3.10.5-py2.7 do use the 'import cPickle as pickle' statement ( only
in ZEO/scripts/zeoqueue.py, ZODB/utils.py & ZODB/tests/testUtils.py), but it
doesn't work if I change those either. There's even more

Has anyone got any ideas why this isn't working?
I can tell that pickle.Unpickler is a class, and that cPickle.Unpickler is a
function.
Usually though, if I 'import cPickle as pickle', and then 'import pickle',
pickle.Unpickler is a class.
However, that is exactly what isn't happening here. There is an 'import
pickle' line immediately before the block where this error is raised. Why
then, is it not importing the pure-python version of pickle? Any ideas??

Cheers,
Alex





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120521/55028dd0/attachment.html>


More information about the Grok-dev mailing list