Ticket #1382 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Five traversable and CMF traversable doesn't have the same behavior

Reported by: tziade Assigned to: fguillaume
Priority: P1 Milestone: CPS 3.4.0
Component: CPS (global) Version: TRUNK
Severity: minor Keywords:
Cc:

Description

when an id doesn't exists, Five raise an AttributeError?. CMF raises a KeyError?.

CPS code relying on the KeyError? exception thus fails when Five hooks OFS.Folder.Folder

I am changing this behavior so CPS catch both, but menanwhile, i am changing the behavior in Five so it raises also KeyError?

Expect the code to get back to one behavior when we get on the next five/2.9 release

Change History

02/08/06 13:02:48 changed by tziade

I've changed the behavior here [32633] [32631]

but we need to audit the code for KeyErrors? that might no be covered by the tests asap

02/14/06 02:50:07 changed by ebarroca

is it fix now ?

02/17/06 18:24:16 changed by tziade

  • status changed from new to closed.
  • resolution set to fixed.

after discussing it over Five ML and internally, it looks like we cannot manage to clean everything up over CMF/CPS/Five, as depending on the cases, KeyError? OR AttributeError? OR NotFound? error where used.

So we won't fix existing code.

The good habit should be now:

- use KeyError? AND AttributeError? for Five code

- use KeyError? for Zope 3 pure code

If you add a traversal in a ZCML file, check over the code that all except KeyError? are seconded by AttributeError? when the use case is a not found traversal. like I did in the current fix. (i'll add it in internal docs as well)