[Zope-Coders] Changes to ZPublisher
Sidnei da Silva
sidnei at awkly.org
Wed Oct 6 10:00:19 EDT 2004
Hello,
I've made some changes on the way ZPublisher deals with
__bobo_traverse__.
Here's the branch:
svn+ssh://svn.zope.org/repos/main/Zope/branches/dc-bobo_traverse-branch
Before the changes, exceptions on __bobo_traverse__ would not be
handled, so if a AttributeError would happen, it would pop up
untouched, resulting on a 500 response status, instead of 404.
It would also try __bobo_traverse__ only, if __bobo_traverse__ exists,
completely ignoring __getattr__ and __getitem__.
After my change, AttributeError and KeyError in __bobo_traverse__
will be converted to a NotFound, resulting in a 404 response status.
It will also continue looking through __getattr__ and __getitem__,
which is where the semantics really differ. I'm more worried about
changing the semantincs because there are other places where
__bobo_traverse__ is used, namely restrictedTravers on OFS.Traversable
and PageTemplates.Expressions.
This change would simplify the implementations of __bobo_traverse__,
which would not have to worry about looking at __getattr__ and
__getitem__ themselves, but I would like to know what people think
first.
The changes would be applied to 2_7-branch and trunk.
--
Sidnei da Silva <sidnei at awkly.org>
http://awkly.org - dreamcatching :: making your dreams come true
http://www.enfoldsystems.com
http://plone.org/about/team#dreamcatcher
Staff meeting in the conference room in 3 minutes.
More information about the Zope-Coders
mailing list