Traversals past pages declared with __call__ attribute generate error 500s

Bug #2149 reported by Christian Reis
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Christian Reis

Bug Description

If you traverse past pages declared using the __call__ attribute, you hit a 500 error. For instance, the IPerson rdf is declared like this:

  <browser:page
      for="canonical.launchpad.interfaces.IPerson"
      name="+rdf"
      lp:url="/person/$Person.name/+rdf"
      permission="zope.Public"
      class="canonical.launchpad.browser.PersonRdfView"
      attribute="__call__"
      />

If you visit https://launchpad.net/people/kiko/+rdf/foobies you get a System Error instead of a good ole 404. The reason being:

    * Module zope.app.publication.publicationtraverse, line 51, in traverseName
      ob2 = ob.publishTraverse(request, nm)
    * Module zope.app.publisher.browser.viewmeta, line 437, in publishTraverse
      raise NotFoundError(self, name, request)

NotFoundError: (<zope.app.publisher.browser.viewmeta.PersonRdfView object at 0x2aa198d950>, u'foobies', <zope.publisher.browser.BrowserRequest instance URL=https://launchpad.net/people/kiko/+rdf/foobies>)

I think NotFoundError is not the right thing to raise there, and that's the source of the bug, but Steve's the man.

Christian Reis (kiko)
Changed in launchpad:
assignee: nobody → stevea
Revision history for this message
Stuart Bishop (stub) wrote :

The __call__ should catch the expected exception and return None rather than NotFoundError

Revision history for this message
Stuart Bishop (stub) wrote :

Ignore me - I'm describing a different bug

Revision history for this message
Steve Alexander (stevea) wrote :

This traverser is presentation code talking directly to the publication, so it should be raising NotFound, the publisher-level exception, or the publisher should be expecting a NotFoundError, and itself raising NotFound. It's a zope3 upstream issue, but we can also fix this locally in launchpad.

Revision history for this message
Dafydd Harries (daf) wrote :

Found this status note which I think should be a comment:

"Look at the xx-notfound-traversals test for some commented out tests that fail because of this."

Changed in launchpad:
status: New → Accepted
Revision history for this message
Christian Reis (kiko) wrote :

This was fixed in the Zope3.2 update. I'm updating the tests to ensure it stays fixed.

Changed in launchpad:
assignee: stevea → kiko
status: Confirmed → In Progress
Christian Reis (kiko)
Changed in launchpad:
status: In Progress → Fix Released
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.