possible regression bug re includeOverrides in pyramid 1.2

34 views
Skip to first unread message

Iain Duncan

unread,
Sep 28, 2011, 6:05:22 PM9/28/11
to pylons...@googlegroups.com
Hey folks, I discovered that my zcml using includeOverrides chokes when I upgrade to Pyramid 1.2. I have tested that the issue goes away or reappears from doing nothing except switching my pyramid egg from 1.1 to 1.2

I have some packages with zcml in them, I include some others that redefine routes, and I include the others like so:

<!-- application's routes -->
<includeOverrides file="routes.zcml" />

With 1.2, I get error messages about conflicting configuration actions, traceback included below

I looked through what's new in Pyramid 1.2 and whats deprecated and couldn't see anything that made me think this would not work anymore, but maybe I missed something?

thanks
Iain

Traceback (most recent call last):
File "bin/paster", line 53, in <module>
paste.script.command.run()
File "/home/cms_demos/Test/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/home/cms_demos/Test/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/home/cms_demos/Test/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/command.py", line 238, in run
result = self.command()
File "/home/cms_demos/Test/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/serve.py", line 284, in command
relative_to=base, global_conf=vars)
File "/home/cms_demos/Test/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/serve.py", line 321, in loadapp
**kw)
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 203, in invoke
app = context.app_context.create()
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/home/stabil/Stabil/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/home/cms_demos/Test/test/app.py", line 85, in app
config.commit()
File "/home/cms_demos/Test/eggs/pyramid-1.2-py2.6.egg/pyramid/config/__init__.py", line 484, in commit
self.action_state.execute_actions()
File "/home/cms_demos/Test/eggs/pyramid-1.2-py2.6.egg/pyramid/config/__init__.py", line 899, in execute_actions
for action in resolveConflicts(self.actions):
File "/home/cms_demos/Test/eggs/pyramid-1.2-py2.6.egg/pyramid/config/__init__.py", line 1013, in resolveConflicts
raise ConfigurationConflictError(conflicts)
pyramid.exceptions.ConfigurationConflictError: Conflicting configuration actions
For: ('view', <class 'pyramid.httpexceptions.HTTPForbidden'>, '', None, <InterfaceClass pyramid.interfaces.IView>, None, None, None, None, None, False, None, None, None, None)
File "/home/cms_demos/Test/test/routes.zcml", line 18.2-23.4
<view
view="test.views.error_views.forbidden_view"
context="pyramid.exceptions.Forbidden"
renderer="test.templates:forbidden.pt"
wrapper="content_wrapper"
/>
File "/home/xornot/framework_pyramid/src/xornot.auth/xornot/auth/configure.zcml", line 12.2-15.4
<forbidden
view="xornot.auth.views.forbidden"
renderer="xornot.auth.templates:forbidden.pt"
/>
iain@musicbox:/home/cms_demos/Test$

Chris McDonough

unread,
Oct 7, 2011, 10:01:11 AM10/7/11
to pylons-devel
On Sep 28, 6:05 pm, Iain Duncan <iainduncanli...@gmail.com> wrote:
> Hey folks, I discovered that my zcml using includeOverrides chokes when I
> upgrade to Pyramid 1.2. I have tested that the issue goes away or reappears
> from doing nothing except switching my pyramid egg from 1.1 to 1.2

I've released a new version of pyramid_zcml (0.7) which I believe
fixes this. Can you try it and see?

Iain Duncan

unread,
Oct 7, 2011, 1:56:58 PM10/7/11
to pylons...@googlegroups.com, chr...@plope.com
Hi Chris, I tried it out with Pyramid 1.2 and pyramid_zcml 0.7. I get a different error, and again, switching the pyramid egg back to 1.1 makes it go away. I've posted the traceback here, and attached the two zcml files, the second of which is being included with includeOverrides

I double checked that swapping the pyramid egg only triggers the issue and that the app runs fine with the attached routes.zcml files in the base xornot.cms package and the overriding test package. 

thanks
Iain

traceback:

File "/home/cms_demos/Test/eggs/pyramid-1.2.1-py2.6.egg/pyramid/config/__init__.py", line 485, in commit
self.action_state.execute_actions()
File "/home/cms_demos/Test/eggs/pyramid-1.2.1-py2.6.egg/pyramid/config/__init__.py", line 905, in execute_actions
callable(*args, **kw)
File "/home/cms_demos/Test/eggs/pyramid-1.2.1-py2.6.egg/pyramid/config/views.py", line 928, in register
route_name)
pyramid.exceptions.ConfigurationExecutionError: <class 'pyramid.exceptions.ConfigurationError'>: No route named content found for view registration
in:
File "/home/xornot/framework_pyramid/src/xornot.cms/xornot/cms/routes.zcml", line 43.2-51.4
<view
for="xornot.dram.interfaces.IResourceContainer"
name=""
view="xornot.dram.views.ListAction"
permission="view"
wrapper="content_wrapper"
route_name="content"
renderer="xornot.cms:templates/resource_list.pt"
/>



--
You received this message because you are subscribed to the Google Groups "pylons-devel" group.
To post to this group, send email to pylons...@googlegroups.com.
To unsubscribe from this group, send email to pylons-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.


routes.zcml
routes.zcml

Chris McDonough

unread,
Oct 7, 2011, 7:25:44 PM10/7/11
to Iain Duncan, pylons...@googlegroups.com
On Fri, 2011-10-07 at 10:56 -0700, Iain Duncan wrote:
> Hi Chris, I tried it out with Pyramid 1.2 and pyramid_zcml 0.7. I get
> a different error, and again, switching the pyramid egg back to 1.1
> makes it go away. I've posted the traceback here, and attached the two
> zcml files, the second of which is being included with
> includeOverrides
>
>
>
> I double checked that swapping the pyramid egg only triggers the issue
> and that the app runs fine with the attached routes.zcml files in the
> base xornot.cms package and the overriding test package.

I think this is actually an independent issue related to the following
(from the CHANGES.txt of Pyramid 1.2.X):

- It may be necessary to more strictly order configuration route and
view statements when using an "autocommitting" Configurator. In the
past, it was possible to add a view which named a route name before
adding a route with that name when you used an autocommitting
configurator. For example::

config = Configurator(autocommit=True)
config.add_view('my.pkg.someview', route_name='foo')
config.add_route('foo', '/foo')

The above will raise an exception when the view attempts to add
itself. Now you must add the route before adding the view::

config = Configurator(autocommit=True)
config.add_route('foo', '/foo')
config.add_view('my.pkg.someview', route_name='foo')

This won't effect "normal" users, only people who have legacy BFG
codebases that used an autommitting configurator and possibly tests
that use the configurator API (the configurator returned by
``pyramid.testing.setUp`` is an autocommitting configurator). The
right way to get around this is to use a non-autocommitting
configurator (the default), which does not have these directive
ordering requirements.

Note that if you're still doing "from pyramid.configuration import
Configurator", that is a autocommitting Configurator. Change that to
"from pyramid.config import Configurator" if so.

- C

> +unsub...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages