[prev in list] [next in list] [prev in thread] [next in thread]
List: zope-dev
Subject: Re: [Zope-dev] SVN: Products.ZCatalog/trunk/ Handle `TypeErrors` in
From: Tres Seaver <tseaver () palladion ! com>
Date: 2011-04-21 19:00:54
Message-ID: 4DB07EE6.1070300 () palladion ! com
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/21/2011 02:07 PM, Hanno Schlichting wrote:
> Log message for revision 121454:
<snip>
> Protect against implicitly acquiring attributes for indexes.
<snip>
> Modified: Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py
> ===================================================================
> --- Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py 2011-04-21 \
> 06:27:40 UTC (rev 121453)
> +++ Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py 2011-04-21 \
> 18:07:09 UTC (rev 121454) @@ -17,6 +17,7 @@
> from logging import getLogger
> import sys
>
> +from Acquisition import aq_base
> from BTrees.IIBTree import intersection
> from BTrees.IIBTree import IITreeSet
> from BTrees.IIBTree import IISet
> @@ -264,6 +265,9 @@
> # self.id is the name of the index, which is also the name of the
> # attribute we're interested in. If the attribute is callable,
> # we'll do so.
> + has_attr = getattr(aq_base(obj), attr, _marker)
> + if has_attr is _marker:
> + return _marker
> try:
> datum = getattr(obj, attr)
> if safe_callable(datum):
This is an API change: it breaks code which deliberately uses
acquisition to supply defaults for indexing purposes. There needs to be
some way to put it back, at least (maybe a zope.conf setting?)
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2wfuYACgkQ+gerLs4ltQ43UACghtYqQjy4zlpO9h8Jjr1dMBd5
37wAoKTiTYFvLKMtyIkVWDw0SycmfPtr
=ptTL
-----END PGP SIGNATURE-----
_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic