[Zope-Checkins] SVN: Products.Five/branches/1.3/ Merge r67186 from
1.2 branch:
Philipp von Weitershausen
philikon at philikon.de
Thu Apr 20 17:48:34 EDT 2006
Log message for revision 67190:
Merge r67186 from 1.2 branch:
Fix traversable bug reported by Jordan Baker (http://codespeak.net/pipermail/z3-five/2006q2/001309.html)
Changed:
U Products.Five/branches/1.3/CHANGES.txt
U Products.Five/branches/1.3/browser/tests/test_traversable.py
U Products.Five/branches/1.3/traversable.py
-=-
Modified: Products.Five/branches/1.3/CHANGES.txt
===================================================================
--- Products.Five/branches/1.3/CHANGES.txt 2006-04-20 21:44:37 UTC (rev 67189)
+++ Products.Five/branches/1.3/CHANGES.txt 2006-04-20 21:48:33 UTC (rev 67190)
@@ -5,9 +5,15 @@
Five 1.3.5 (unreleased)
=======================
-* Made sure LocalizerLanguages class normalized language codes to xx-yy, instead of
- xx_YY or xx-YY.
+Bugfixes
+--------
+* Made sure LocalizerLanguages class normalized language codes to
+ xx-yy, instead of xx_YY or xx-YY.
+
+* Fixed a problem with the new traversal look-up order and the root
+ object (OFS.Application.Application).
+
Five 1.3.4 (2006-03-31)
=======================
Modified: Products.Five/branches/1.3/browser/tests/test_traversable.py
===================================================================
--- Products.Five/branches/1.3/browser/tests/test_traversable.py 2006-04-20 21:44:37 UTC (rev 67189)
+++ Products.Five/branches/1.3/browser/tests/test_traversable.py 2006-04-20 21:48:33 UTC (rev 67190)
@@ -207,8 +207,8 @@
... xmlns:meta="http://namespaces.zope.org/meta"
... xmlns:browser="http://namespaces.zope.org/browser"
... xmlns:five="http://namespaces.zope.org/five">
- ... <!-- make the zope2.Public permission work -->
- ... <meta:redefinePermission from="zope2.Public" to="zope.Public" />
+ ... <!-- make the zope2.Public permission work -->
+ ... <meta:redefinePermission from="zope2.Public" to="zope.Public" />
... <browser:page
... name="eagle"
... for="OFS.interfaces.IObjectManager"
@@ -216,6 +216,7 @@
... attribute="eagle"
... permission="zope2.Public"
... />
+ ... <five:traversable class="OFS.Application.Application"/>
... </configure>'''
>>> import Products.Five
>>> from Products.Five import zcml
@@ -252,13 +253,32 @@
The eagle has landed
+ Some weird implementations of __bobo_traverse__, like the one
+ found in OFS.Application, raise NotFound. Five still knows how to
+ deal with this, hence views work there too:
+
+ >>> print http(r'''
+ ... GET /eagle HTTP/1.1
+ ...
+ ... ''')
+ HTTP/1.1 200 OK
+ ...
+ The eagle has landed
+
+ >>> print http(r'''
+ ... GET /@@eagle HTTP/1.1
+ ...
+ ... ''')
+ HTTP/1.1 200 OK
+ ...
+ The eagle has landed
+
Clean up:
>>> from zope.app.testing.placelesssetup import tearDown
>>> tearDown()
"""
-
def test_suite():
from Testing.ZopeTestCase import FunctionalDocTestSuite
return FunctionalDocTestSuite()
Modified: Products.Five/branches/1.3/traversable.py
===================================================================
--- Products.Five/branches/1.3/traversable.py 2006-04-20 21:44:37 UTC (rev 67189)
+++ Products.Five/branches/1.3/traversable.py 2006-04-20 21:48:33 UTC (rev 67190)
@@ -63,6 +63,14 @@
return self.__fallback_traverse__(REQUEST, name)
except (AttributeError, KeyError):
pass
+ except NotFound:
+ # OFS.Application.__bobo_traverse__ calls
+ # REQUEST.RESPONSE.notFoundError which sets the HTTP
+ # status code to 404
+ try:
+ REQUEST.RESPONSE.setStatus(200)
+ except AttributeError:
+ pass
else:
try:
return getattr(self, name)
More information about the Zope-Checkins
mailing list