I release a new version of repoze.zcml (0.2) a few days ago that depends
explicitly on zope.component>=3.5.0. But this won't help you if you really do
want it to work under stock 3.4.

I think the ultimate fix is to remove the ZCML from chameleon (and thus not
depend on repoze.zcml or zope.component at all).  I'm waiting for malthe to
unhiberate to talk about this.

In the meantime, you should be able to *not* include the ZCML that comes with
chameleon.zpt and do this in your Zope 3 app:

<configure xmlns="http://namespaces.zope.org/zope";

     component=".expressions.python_translator" />

     factory=".expressions.StringTranslator" />



Sidnei da Silva wrote:
> Hi there,
> I'm trying to pull chameleon into a project that's still using zope
> 3.4. By consequence of the last changes, repoze.zcml is now being
> pulled in. There is a problem though: repoze.zcml is not completely
> compatible with zope 3.4. The following error happens at startup time:
>   File "/home/sidnei/src/lp/template-speedup/database/schema/../../lib/
> zope/configuration/config.py", line 610, in execute_actions
>   File "/home/sidnei/virtual/chameleon/lib/python2.4/site-packages/
> repoze.zcml-0.2-py2.4.egg/repoze/zcml/__init__.py", line 14, in
> handler
>     method(*args, **kwargs)
> zope.configuration.config.ConfigurationExecutionError:
> exceptions.TypeError: registerUtility() got an unexpected keyword
> argument 'factory'
>   in:
>   File "/home/sidnei/src/chameleon/deps/chameleon.zpt/src/chameleon/
> zpt/configure.zcml", line 6.2-8.50
>     <utility
>        name="python"
>        component=".expressions.python_translator" />
> The problem is caused by this snippet from repoze.zcml:
>     _context.action(
>         discriminator = ('utility', provides, name),
>         callable = handler,
>         args = ('registerUtility', component, provides, name),
>         kw = dict(factory=factory),
>         )
> Casual inspection shows that the 'factory' argument to registerUtility
> did not exist on zope 3.4. Looks like an easy fix, though I will leave
> it up to you guys on how to best fix it. In my environment, I just
> removed the line that passes 'factory' along and then everything else
> seems to work fine (read: it starts up).
> --
> Sidnei da Silva
> _______________________________________________
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev

Repoze-dev mailing list

Reply via email to