[Zope-dev] bug in OFS/Traversable.py

2001-09-13 Thread Martijn Faassen

Hi there,

There appears to be a bug in Zope 2.4.1's OFS/Traversable.py. I've tried
to identify the same bug in the CVS, but oddly enough I couldn't find it.
There doesn't appear to be any Zope 2.4.1 CVS branch and the Zope 2.4
branch didn't have any changes to this file in 3 months, but doesn't
seem to have the same problem. Odd.

Anyway, the bug isn't a large one; just a few uses of 'has' where 'hasattr'
should be used (or there should be a line 'has = hasattr' somewhere near
'get = getattr').

Here's a diff that seems to fix the problem:

193c193
 if has(o, 'im_self'):
---
 if hasattr(o, 'im_self'):
195c195
 elif (has(get(object, 'aq_base', object), name)
---
 elif (hasattr(get(object, 'aq_base', object), name)

So again, this is true for Zope 2.4.1 (source release), while the CVS
does not appear to have the problem (but it just looks rather different
in other places as well, even though last change was 3 months ago; I do not
understand).

Anyway, just so the bug won't be present in any new release.

Regards,

Martijn


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Bug in OFS/Traversable.py

2000-09-12 Thread Chris Withers



David Alexander Ranvig wrote:
 The unrestrictedTraverse method creates a fake REQUEST "object"
 (really a dictionary) and sends this to a __bobo_traverse__. If this
 __bobo_traverse__ uses the object properties of the REQUEST object, or
 needs the real REQUEST object it will fail.

I chuck that in the collector... it'll probably just get lost in the
lists otherwise...

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )