zope.traversing.adapters.DefaultTraversable.traverse() uses getattr() with a default value that hides the real exception. It should call getattr() without a default value, so that it can log the actual error that occurs.
Traceback (most recent call last):
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/publisher/publish.py", line 133, in publish
result = publication.callObject(request, obj)
File "/home/egrubbs/canonical/lp-branches/bug-174468-milestone-release-overlap/lib/canonical/launchpad/webapp/publication.py", line 341, in callObject
return mapply(ob, request.getPositionalArguments(), request)
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/publisher/publish.py", line 108, in mapply
return debug_call(obj, args)
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/publisher/publish.py", line 114, in debug_call
return obj(*args)
File "/home/egrubbs/canonical/lp-branches/bug-174468-milestone-release-overlap/lib/canonical/launchpad/webapp/publisher.py", line 224, in __call__
return self.render()
File "/home/egrubbs/canonical/lp-branches/bug-174468-milestone-release-overlap/lib/canonical/launchpad/webapp/publisher.py", line 209, in render
return self.template()
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/app/pagetemplate/viewpagetemplatefile.py", line 83, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/app/pagetemplate/viewpagetemplatefile.py", line 51, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 271, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 891, in do_useMacro
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 521, in do_optTag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 516, in no_tag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 855, in do_condition
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 855, in do_condition
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 521, in do_optTag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 516, in no_tag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 949, in do_defineSlot
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 822, in do_loop_tal
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/tales.py", line 682, in setRepeat
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/tales.py", line 696, in evaluate
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/expressions.py", line 217, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/expressions.py", line 194, in _eval
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/expressions.py", line 124, in _eval
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/app/pagetemplate/engine.py", line 68, in __call__
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/traversing/adapters.py", line 164, in traversePathElement
return traversable.traverse(nm, further_path)
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/traversing/adapters.py", line 52, in traverse
raise TraversalError(subject, name)
TraversalError: (<zope.app.pagetemplate.simpleviewclass.SimpleViewClass from /home/egrubbs/canonical/lp-branches/bug-174468-milestone-release-overlap/lib/canonical/launchpad/templates/product-index.pt object at 0xcb7c3cc>, 'sorted_series_list')
------
2008-12-23T18:13:46 ERROR SiteError https://launchpad.dev/bzr/+index
Traceback (most recent call last):
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/publisher/publish.py", line 133, in publish
result = publication.callObject(request, obj)
File "/home/egrubbs/canonical/lp-branches/bug-174468-milestone-release-overlap/lib/canonical/launchpad/webapp/publication.py", line 341, in callObject
return mapply(ob, request.getPositionalArguments(), request)
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/publisher/publish.py", line 108, in mapply
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/app/pagetemplate/viewpagetemplatefile.py", line 51, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 271, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 891, in do_useMacro
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 521, in do_optTag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 516, in no_tag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 855, in do_condition
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 855, in do_condition
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 521, in do_optTag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 516, in no_tag
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 949, in do_defineSlot
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tal/talinterpreter.py", line 822, in do_loop_tal
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/tales.py", line 682, in setRepeat
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/tales.py", line 696, in evaluate
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/expressions.py", line 217, in __call__
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/expressions.py", line 194, in _eval
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/tales/expressions.py", line 124, in _eval
File "/home/egrubbs/canonical/lp-branches/new-project-bug-256442/lib/zope/app/pagetemplate/engine.py", line 68, in __call__
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/traversing/adapters.py", line 164, in traversePathElement
return traversable.traverse(nm, further_path)
File "/home/egrubbs/canonical/lp-branches/trunk/utilities/../lib/zope/traversing/adapters.py", line 52, in traverse
raise TraversalError(subject, name)
TraversalError: (<zope.app.pagetemplate.simpleviewclass.SimpleViewClass from /home/egrubbs/canonical/lp-branches/bug-174468-milestone-release-overlap/lib/canonical/launchpad/templates/product-index.pt object at 0xcb7c3cc>, 'sorted_series_list')
On Dec 24, 2008, at 1:18 AM, Edwin Grubbs wrote: .adapters. DefaultTraversa ble.traverse( ) uses getattr()
> zope.traversing
> with a default value that hides the real exception. It should call
> getattr() without a default value, so that it can log the actual error
> that occurs.
To my knowledge, getattr(obj, attr, default) will only "eat"
AttributeErrors. If an AttributeError occurs, it'll return the
default. Any other exception should be penetrate to the caller without
any problems. I think this behaviour makes a lot of sense.
So if you're experiencing that getattr() hides a "real" exception in ble.traverse( ) would have
the code, it seems to me that this exception must be an
AttributeError. But then you'd be out of luck if getattr() didn't use
a default value, because then DeafultTraversa
to do something like:
try:
subobj = getattr(obj, attr)
except AttributeError:
... do something else
So your exception wouldn't be visible anyways.