[Grok-dev] z3c.autoinclude hiding configuration conflict errors(?)

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Nov 18 11:18:16 EST 2008


Hi,


Today I noticed something strange. z3c.autoinclude appears to swallow
ConfigurationConflictError errors.

Say I have a grok project (created with grokproject-0.9) called
foobar. In the app.py that is created I add a skin definition like so:

  class ISomeLayer(grok.IBrowserRequest):
    grok.skin('foo')

Then I create, again with grokproject, a project called qux. In the
app.py modules of the qux project I also add a skin definition,
*identical* to the one I added in foobar's app.py. Then I add foobar
as a dependeny to qux, by way of qux's setup.py and develop directive
in qux's buildout.cfg.

Grokproject generated a configure.zcml for qux like so:

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:grok="http://namespaces.zope.org/grok">
  <include package="grok" />
  <includeDependencies package="." />
  <grok:grok package="." />
</configure>

The important part here is the <includeDependencies> directive that
will make sure the configure.zcml of foobar is included and thus that
foobar is grokked too.

Now, running "qux/bin/zopectl fg" starts Zope with no complaint.
*However* zope *should have* complained, as registering multiple skins
with the same name should really raise a ConfigurationConflictError.
And indeed, if you'd change qux's configure.zcml to...

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:grok="http://namespaces.zope.org/grok">
  <include package="grok" />
  <grok:grok package="foobar" />
  <grok:grok package="." />
</configure>

...trying to start zope with "qux/bin/zopectl fg" won't work, indeed
complaining with a configuration conflict!


I did have a quick look into z3c.autoinclude but cannot find an
obvious culprit... Anyone an idea here? Who wrote z3c.autoinclude? Can
he/they help?


regards,
jw

-- 
Jan-Wijbrand Kolman


More information about the Grok-dev mailing list