Log message for revision 67193: 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/trunk/CHANGES.txt U Products.Five/trunk/browser/tests/test_traversable.py U Products.Five/trunk/traversable.py -=- Modified: Products.Five/trunk/CHANGES.txt =================================================================== --- Products.Five/trunk/CHANGES.txt 2006-04-20 22:02:15 UTC (rev 67192) +++ Products.Five/trunk/CHANGES.txt 2006-04-20 22:07:12 UTC (rev 67193) @@ -2,12 +2,18 @@ Five Changes ============ -Trunk (unreleased) -======================= +Five 1.4 (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.4b (2006-03-31) ====================== Modified: Products.Five/trunk/browser/tests/test_traversable.py =================================================================== --- Products.Five/trunk/browser/tests/test_traversable.py 2006-04-20 22:02:15 UTC (rev 67192) +++ Products.Five/trunk/browser/tests/test_traversable.py 2006-04-20 22:07:12 UTC (rev 67193) @@ -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/trunk/traversable.py =================================================================== --- Products.Five/trunk/traversable.py 2006-04-20 22:02:15 UTC (rev 67192) +++ Products.Five/trunk/traversable.py 2006-04-20 22:07:12 UTC (rev 67193) @@ -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) _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins