[Zope3-Users] Registered utility is never found

FB fbo2 at gmx.net
Tue Dec 12 11:27:14 EST 2006


On Tue, Dec 12, 2006 at 05:29:55PM +0300, Garanin Michael wrote:
> FB wrote:
> >On Tue, Dec 12, 2006 at 04:42:56PM +0300, Garanin Michael wrote:
> >  
> >>traceback, please.
> >>    
> >
> >Hmm ... how? It just doesn't return the utility as expected (it returns
> >None). There is no error shown in any way.
> >
> >  
> 
> >from APIDOC:
> """
> 
>    * *|getUtility(interface, name='', context=None)| *
> 
>      .....         If one is not found, raises
>      ComponentLookupError.               <==== must be EXCEPTION !!!
> 
> 
> """
> 
> There are not "ComponenLookupError" exception? Why you find bug in "getUtility"? ;-)

Sorry - my fault :-) I'm using queryUtility all the time. Here's the traceback:

  File "/var/lib/zope3/instance/lib/python/fb/init/tales.py", line 29, in warn
    indicator=zapi.getUtility(IInitIndicator,None)
  File "/ZOPE/zope3/src/zope/component/_api.py", line 207, in getUtility
    raise ComponentLookupError(interface, name)
ComponentLookupError: (<InterfaceClass fb.init.interfaces.IInitIndicator>, None)

Regards,

Frank


More information about the Zope3-users mailing list