[z3-five] 0.2 release

Sidnei da Silva sidnei at awkly.org
Thu Sep 30 13:18:42 MEST 2004


On Wed, Sep 15, 2004 at 02:58:53PM +0200, Martijn Faassen wrote:
| Anyway, another thing to do with our release is fix the 'docstring 
| missing' bug in case what you're looking for is not found. Sidnei was 
| saying something about doing this for a reason (path expressions in 
| ZPT?). I'm unclear about the reason; could we have details? He also said 
| this only appears in some setups of Zope. What does that mean?

Ok, here's the thing, after changing it to raise NotFoundError:

# Expression: standard:'here/navtree_properties/croppingLength |
portal_properties/navtree_properties/croppingLength | python:18'
Names:

{'container': <PloneSite instance at 31796c20>,
 'context': <PloneSite instance at 31796c20>,
 'default': <Products.PageTemplates.TALES.Default instance at
 0x307c2ee0>,
 'here': <PloneSite instance at 31796c20>,
 'loop': <SafeMapping instance at 332431a0>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
 instance at 0x307bb0f8>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 332431a0>,
 'request': <HTTPRequest,
 URL=http://localhost:8180/uscib/folder_listing>,
 'root': <Application instance at 31786260>,
 'template': <FSPageTemplate at /uscib/folder_listing>,
 'traverse_subpath': [],
 'user': Anonymous User}

# Module Products.PageTemplates.Expressions, line 201, in __call__
# Module Products.PageTemplates.Expressions, line 181, in _eval
# Module Products.PageTemplates.Expressions, line 145, in _eval
__traceback_info__: here
# Module Products.PageTemplates.Expressions, line 325, in
# restrictedTraverse
__traceback_info__: {'path': ['navtree_properties', 'croppingLength'],
# 'TraversalRequestNameStack': ['croppingLength']}
# Module Products.Five.traversable, line 78, in __bobo_traverse__
# Module Products.Five.traversable, line 50, in __fallback_traverse__
# Module ZPublisher.HTTPResponse, line 630, in notFoundError

So, in PageTemplates.Expressions, around line 325:

        t=get(object, '__bobo_traverse__', N)
        if t is not N:
            o=t(REQUEST, name)

            container = None
            if aq_base(o) is not o:
                # The object is wrapped, so the acquisition                        
                # context determines the container.                                
                container = aq_parent(aq_inner(o))
            elif has(o, 'im_self'):
                container = o.im_self
            elif (has(aq_base(object), name) and get(object, name) ==
            o):
                container = object
            if not validate(object, container, name, o):
                raise Unauthorized, name

This only happens in Zope2 Page Templates, afaict. Eg: I added a
similar test to a page template in FiveTest and it works.

-- 
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

<sjj> dash: you certainly are an enigma wrapped in a riddle wrapped in a hat.


More information about the z3-five mailing list