[Zope-dev] ZCatalog regression: indexing None values

yuppie y.2015 at wcm-solutions.de
Thu Feb 5 12:36:48 CET 2015


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


More information about the Zope-Dev mailing list