6.4.2.2.
CMFCore.permissions import syntax change
Up one level
Typical error message when starting Zope:
File "Products/PloneHelpCenter/content/HelpCenter.py", line 29, in ?
from Products.CMFCore import CMFCorePermissions
ImportError: cannot import name CMFCorePermissions
What's causing it:
The following line is a common statement to get access to the permissions module, typically in the __init__.py file:
from Products.CMFCore import CMFCorePermissions
To make this work with both the new way of importing it and fall back to the old way if you're running an older version, replace the above with:
try: # New CMF
from Products.CMFCore import permissions as CMFCorePermissions
except ImportError: # Old CMF
from Products.CMFCore import CMFCorePermissions
Then you should be all set, and be able to support multiple versions with your product. Note that the try/except block is only necessary if you want to support Plone 2.1, if you're targeting Plone 2.5 and above, you only have to do the variant listed under "New CMF" in the example above.
To see a live example of this change, consult Poi changeset 40594.