[DM] (un)restrictedTraverse depending on request

Bug #373658 reported by Andreas Jung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Wishlist
Andreas Jung

Bug Description

2. Introduction

Zope 2.11 has integrated the Zope view lookup directly into traversal, both the ZPublisher traversal as well as [un]restrictedTraverse. View lookup is technically a lookup for an adapter for the pair object, request. Of course, this can succeed only when there is a request and especially not in scripts run outside a web publishing environment. Zope 2.11 does not take this into account: [un]restrictedTraverse (and friends as TALES path expressions) fail with an exception when no request is available.

3. Feature

Ensure that [un]restrictedTraverse does not fail due to a missing request.

Of course, if a view should be looked up, this will still fail when no request is available. Only traversals not requiring views should succeed without request.

4. Example Use Cases

Many of our scripts do not have a natural request. While it would be possible to give them an artificial one, it is more natural to change Zope not to insist on a request for [un]restrictedTraverse.

Revision history for this message
Andreas Jung (ajung) wrote :
Changed in zope2:
assignee: nobody → Andreas Jung (ajung)
Changed in zope2:
importance: Undecided → Wishlist
status: New → Confirmed
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: Confirmed → 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.