BaseRequest.traverse doesn't handle __bobo_traverse__ correctly

Bug #143022 reported by Joachim Werner
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

The books say that if __bobo_traverse__ doesn't find an object to return it should return None. But the code in the traverse method of BaseRequest in ZPublisher/BaseRequest.py doesn't handle None-objects.

The issue is that if __bobo_traverse__ returns None the "normal" traversal is skipped. If the object that we are looking for does not exist we then get a "missing docstring" error instead of the NotFound error we'd expect. This is because a None object has no docstring ...

Attached is a patch for 2.7.1b1. This patch seems to work, but is highly unelegant.

Revision history for this message
Joachim Werner (bavarian) wrote :
Tres Seaver (tseaver)
tags: added: bugday20100519
Tres Seaver (tseaver)
tags: added: bugday
removed: bug+solution bugday20100519 zope
Tres Seaver (tseaver)
Changed in zope2:
status: New → Triaged
tags: added: traversal
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.