On Aug 14, 2007, at 7:32 PM, Paul Carduner wrote:

Hello zope3-dev,

I came across an error I have not seen before.  Just for reference,
here is the last snippet from the traceback:

File "/home/pcardune/Work/ZContact/zcontact-lp/eggs/tmpgwuq6O/ zope.security-3.4.0b4-py2.4-linux-i686.egg/zope/security/checker.py",
line 420, in ?
AttributeError: 'module' object has no attribute 'thread_local'

I wish you had included the whole traceback.

The interesting part to me is that it was so easy to fix.  Here is a
snippet of the relevant area of failing code from

# Get optimized versions
    import zope.security._zope_security_checker
except ImportError:
from zope.security._zope_security_checker import _checkers, selectChecker
    from zope.security._zope_security_checker import NoProxy, Checker
    from zope.security._zope_security_checker import _defaultChecker
from zope.security._zope_security_checker import _available_by_default
    zope.interface.classImplements(Checker, INameBasedChecker)

The very first import statement is throwing the error, but alas, it is
not an ImportError.  If I patch this code by catching the
AttributeError in the same way the ImportError is caught, then
everything works fine.

Except you don't get the C optimizations. IOW, you would just be covering up a real error.

I tried looking into the c code, but after
years of python development, the c code just frightens me (a bit).
That said, I would really appreciate any pointers people might be able
to give me on what thread_local is for and why I (don't) need it.

I rearranged the imports in zope.security yesterday. I apparently broke your usage, but I can't tell what your usage is. I'll need to see the whole traceback. In particular, I'll need to see the import order.


Jim Fulton                      mailto:[EMAIL PROTECTED]                Python 
CTO                             (540) 361-1714                  
Zope Corporation        http://www.zope.com             http://www.zope.org

Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to