URL-Traversal aware '__bobo_traverse__'

Bug #143246 reported by Dieter Maurer
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

"__bobo_traverse__" is used both for URL
traversal and various "[un]restrictedTraverse" implementations.

Unfortunately, "not found" needs to be handled
quite differently during URL traversal ("NullResource" generation,
RESPONSE.notFoundError") and unrestrictedTraverse ("AttributeError").

The best way would be to pass this information as parameter
to "__bobo_traverse__". But, its signature does not support
this.

As a workaround, the attached patch sets the attribute "performingUrlTraversal"
on REQUEST. "__bobo_traverse__" implementations can check it
to perform the correct thing when they cannot resolve "name".
The check should have the form

    "getattr(REQUEST, 'performingUrlTraversal', False)"

Revision history for this message
Dieter Maurer (d.maurer) wrote :
Tres Seaver (tseaver)
Changed in zope2:
status: New → Triaged
tags: added: bugday traversal
removed: feature+solution zope
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.