[Zope-dev] ZCatalog regression: indexing None values

Patrick Gerken lists at patrick-gerken.de
Thu Feb 5 13:28:54 CET 2015


it should be said that the commit you mention clearly states the change
you describe, updates the version number to make sure this won't be
a patch and explains why he changed the behavior. namely to stay
compatible with BTrees 4.

Without looking into this more I'd say this is a required update to work
With Python 3.

On 05.02 12:36, yuppie wrote:
> Hi!
> Indexes shipped with ZCatalog 3 no longer work with None values:
> https://github.com/zopefoundation/Products.ZCatalog/commit/c378cdab2fb8997af1a17261458a1528e7131243
> I'm not sure if the old behavior did follow a well defined policy, I
> just found this explanation:
> http://stackoverflow.com/a/11224076
> I think in general the policy was to ignore None values if the index
> can't handle them. And AFAICS that's a much better policy than raising
> errors as ZCatalog 3 does.
> There is nothing wrong about None values returned by content attributes.
> Often they have a special meaning like not initialized, not selected,
> not specified. In most cases it wouldn't cause trouble if None is not
> indexed, but it causes trouble if indexing raises errors.
> Adjusting code that implements special behavior for None, adjusting
> persistent attributes that contain None or adding wrappers that modify
> indexed attributes is a lot of work.
> I propose to ignore None values instead of raising errors.
> Cheers,
> 	Yuppie
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at 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 )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mail.zope.org/pipermail/zope-dev/attachments/20150205/1cecebdb/attachment.sig>

More information about the Zope-Dev mailing list