我在金字塔中創建應用時遇到了問題。當我嘗試通過貼紙服務時,我得到:金字塔配置加載錯誤
File "/home/viraptor/blah/blah/__init__.py", line 23, in main
return config.make_wsgi_app()
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 916, in make_wsgi_app
self.commit()
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 491, in commit
self._ctx.execute_actions()
File "/home/viraptor/pyramid/lib/python2.6/site-packages/zope/configuration/config.py", line 626, in execute_actions
callable(*args, **kw)
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 1291, in register
derived_view = deriver(view)
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 2681, in __call__
self.mapped_view(view))))))))
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 2624, in inner
wrapped_view = wrapped(self, view)
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 2693, in mapped_view
mapped_view = mapper(**self.kw)(view)
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 2860, in __call__
view = self.map_nonclass(view)
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 2876, in map_nonclass
ronly = requestonly(view, self.attr)
File "/home/viraptor/pyramid/lib/python2.6/site-packages/pyramid/config.py", line 2966, in requestonly
if len(args) - len(defaults) == 1:
zope.configuration.config.ConfigurationExecutionError: <type 'exceptions.TypeError'>: object of type 'NoneType' has no len()
in:
('/home/viraptor/blah/blah/__init__.py', 22, 'main', "config.add_route('customer', '/customer/{customer_id}', view='blah.views.customer.view', view_renderer='customer_view.mak', view_permission='view', traverse='/customer/{customer_id}')")
這是什麼原因?我最近甚至沒有改變這個配置,只有應用的其他部分。
你沒有包含實際的異常,只有堆棧跟蹤。沒有人知道現在發生了什麼,只有在...... :-) – 2011-04-24 10:37:24
@Martijn Pieters - Python在最後打印異常 - 它在那裏。這是ConfigurationExecutionError。 – viraptor 2011-04-24 10:41:47
啊,我的錯,我iPhone上的移動視圖沒有顯示整個文本,我也沒有跡象表明它更長。道歉! – 2011-04-24 10:50:58