[Zope-CMF] Re: getUtility(ISiteRoot) bug?

Ross Patterson me at rpatterson.net
Thu Mar 8 12:58:21 EST 2007


yuppie <y.2007- at wcm-solutions.de> writes:

> I'm stuck. In CMFCore.Expression.getExprContext I tried to replace::
>
>         utool = getUtility(IURLTool)
>         portal = utool.getPortalObject()
>
> by::
>
>         portal = getUtility(ISiteRoot)
>
>
> I can't get this working. The lookup from within getExprContext fails. But:
>
> - sm.registeredUtilities() contains the ISiteRoot registration
>
> - if I first call getUtility(ISiteRoot) from somewhere else, the
> lookup doesn't fail in getExprContext either (I guess the result of
> some caching)
>
> - getUtility(IURLTool) *does* work, and inside getPortalObject()
> looking up the ISiteRoot utility works as well
>
>
> The lookup is in C code, I don't know C and how to debug that. No idea
> what's going wrong here.
>
> Any pointers?

I often rename zope/interface/_zope_interface_coptimizations.so to
zope/interface/_zope_interface_coptimizations.so.bak so that the
Python implementation is used and I can step into it in PDB. 

Ross



More information about the Zope-CMF mailing list