[ZCM] [ZC] 1083/ 2 Accept "InitializeClass doesn't work with new style classes"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Oct 13 11:54:55 EDT 2003


Issue #1083 Update (Accept) "InitializeClass doesn't work with new style classes"
 Status Accepted, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/1083

==============================================================
= Accept - Entry #2 by Brian on Oct 13, 2003 11:54 am

 Status: Pending => Accepted

 Supporters added: Brian

I'm marking this 'accepted', though I suspect it will not 
be resolved until Zope 2.8.

There are a number of potential problems with trying to use 
new-style classes in Zope 2.6 / 2.7. They cannot, for example, 
subclass Persistent (ExtensionClass is not compatible with 
new-style classes) and, as you've found, some of the machinery 
for security and other parts of the system depend on class 
semantics that are now different for new-style classes.

The plan is that the focus of Zope 2.8 will be to replace the 
use of ExtensionClass with new-style classes and begin bringing 
parts of the Zope 3 infrastructure into Zope 2. This issue will 
likely be resolved as a part of that effort.


________________________________________
= Request - Entry #1 by Tiran on Oct 11, 2003 8:34 pm

The Globals.InitializeClass function does not apply with a new style class. If I inherit from object the product code raises a TypeError. Without inheriting (-> old style class) it works.

Traceback:

    InitializeClass(PhotoEngineBase)
  File "/usr/lib/zope/2.7-branch-23/lib/python/App/class_init.py", line 61, in default__class_init__
    security_info.apply(self)
  File "/usr/lib/zope/2.7-branch-23/lib/python/AccessControl/SecurityInfo.py", line 165, in apply
    dict['%s__roles__' % name] = access
TypeError: object does not support item assignment
==============================================================




More information about the Zope-Collector-Monitor mailing list