Endless loop with Acquisition and ILocation in Products.Five.component findSite

Bug #434422 reported by gweis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Unassigned

Bug Description

Prodcuts.Five.component findSite using the ILocation API or if not available the Acquisition chain to find a parent object. If an object Acquisition wrapped object implements the ILocation API the parent retrieved from obj.__parent__ is aq-wrapped in the context of obj which leads to an endless loop in finding an ISite.

The attached patches contain a doc-test to demonstrate the behaviour and a suggested fix. The fix just checks if the object is aq-wrapped before accessing the __parent__ attribute. This basically means, Acquisition is given preference to ILocation.

The patch against current Zope 2.11 development branch, and most likely applies to 2.10 too. I am not sure about 2.12 because there have been some changes to the Acquisition module.

cheers

Gerhard

Tags: bug+solution
Revision history for this message
gweis (gerhard-weis) wrote :
Revision history for this message
gweis (gerhard-weis) wrote :
description: updated
gweis (gerhard-weis)
tags: added: bug+solution
Revision history for this message
Hanno Schlichting (hannosch) wrote :

In Zope 2.12 Acquisition has been made aware of __parent__pointers and the code ling in findSite only uses aq_parent, which does the correct thing internally.

Changed in zope2:
status: New → 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.