Andy McKay

Sep 11, 2006

Deprecation warning - deprecations need to deprecated


I don’t know about you, but the deprecation warnings when Plone starts up are getting kind of annoying. Here’s the trimmed down version:

2006-09-11 22:44:25 WARNING Init Class Products.ATContentTypes.content.base.ATCTFolderMixin has a security declaration for nonexistent method 'manage_copyObjects' 2006-09-11 22:44:28 WARNING Plone Deprecation Warning The CMFPlone.MemberData class will be removed in Plone 3.0 2006-09-11 22:44:30 WARNING Plone Deprecation Warning CustomizationPolicies are deprecated and will be removed in Plone 3.0. Please use GenericSetup extension profiles instead. 2006-09-11 22:44:30 WARNING Plone Deprecation Warning registerSetupWidget is deprecated and will be removed in Plone 3.0. 2006-09-11 22:44:30 WARNING Plone Deprecation Warning registerSetupWidget is deprecated and will be removed in Plone 3.0. 2006-09-11 22:44:37 WARNING Plone Deprecation Warning CustomizationPolicies are deprecated and will be removed in Plone 3.0. Please use GenericSetup extension profiles instead. 2006-09-11 22:44:38 WARNING Plone Deprecation Warning registerSetupWidget is deprecated and will be removed in Plone 3.0. .. and a few removed (see below)

Further if you set etc/zope.conf to only show errors and above you still get a few:

/opt/Plone-2.5/lib/python/ZServer/utils.py:33: DeprecationWarning: The zLOG package is deprecated and will be removed in Zope 2.11. Use the Python logging module instead. LOG('ZServer', severity[type], message) /opt/Plone-2.5/Instance/Products/Marshall/handlers/__init__.py:38: UserWarning: libxml2 not available. Unable to register libxml2 based marshallers warnings.warn('libxml2 not available. Unable to register libxml2 based ' /opt/Plone-2.5/Instance/Products/CMFSquidTool/Permissions.py:19: DeprecationWarning: The module, 'Products.CMFCore.CMFCorePermissions' is a deprecated compatiblity alias for 'Products.CMFCore.permissions'; please use the new module instead. from Products.CMFCore.CMFCorePermissions import ManagePortal /opt/Plone-2.5/Instance/Products/CMFSquidTool/__init__.py:38: DeprecationWarning: The product_name parameter of ToolInit is deprecated and will be ignored in CMF 2.0: CMFSquidTool icon="tool.gif", /opt/Plone-2.5/Instance/Products/CacheSetup/config.py:23: DeprecationWarning: The zLOG package is deprecated and will be removed in Zope 2.11. Use the Python logging module instead. LOG(PROJECT_NAME, INFO, msg) /opt/Plone-2.5/lib/python/OFS/Application.py:835: DeprecationWarning: __init__.py of Products.ExternalEditor has a long deprecated 'methods' attribute. 'methods' will be ignored by install_product in Zope 2.10. Please use registerClass instead. DeprecationWarning) /opt/Plone-2.5/Instance/Products/MemcachedManager/__init__.py:8: DeprecationWarning: The zLOG package is deprecated and will be removed in Zope 2.11. Use the Python logging module instead. LOG('MemcachedManager', log_level, summary, text) /opt/Plone-2.5/Instance/Products/kupu/plone/__init__.py:32: DeprecationWarning: The product_name parameter of ToolInit is deprecated and will be ignored in CMF 2.0: kupu icon="kupu_icon.gif", /opt/Plone-2.5/lib/python/Signals/SignalHandler.py:39: DeprecationWarning: The zLOG package is deprecated and will be removed in Zope 2.11. Use the Python logging module instead. zLOG.LOG('Z2', zLOG.BLATHER, "Installed sighandler for %s" % ( /opt/Plone-2.5/lib/python/OFS/subscribers.py:74: DeprecationWarning: Products.CMFPlone.QuickInstallerTool.QuickInstallerTool.manage_afterAdd is deprecated and will be removed in Zope 2.11, you should use event subscribers instead, and meanwhile mark the class with DeprecationWarning) /opt/Plone-2.5/lib/python/OFS/subscribers.py:74: DeprecationWarning: Products.PluggableAuthService.PluggableAuthService.PluggableAuthService.manage_afterAdd is deprecated and will be removed in Zope 2.11, you should use event subscribers instead, and meanwhile mark the class with DeprecationWarning) /opt/Plone-2.5/Instance/Products/PluggableAuthService/plugins/BasePlugin.py:71: DeprecationWarning: isImplementedBy has been renamed to providedBy return interface.isImplementedBy( self ) /opt/Plone-2.5/lib/python/OFS/subscribers.py:74: DeprecationWarning: Products.PlonePAS.plugins.cookie_handler.ExtendedCookieAuthHelper.manage_afterAdd is deprecated and will be removed in Zope 2.11, you should use event subscribers instead, and meanwhile mark the class with DeprecationWarning) /opt/Plone-2.5/lib/python/OFS/subscribers.py:74: DeprecationWarning: Products.PlonePAS.plugins.role.GroupAwareRoleManager.manage_afterAdd is deprecated and will be removed in Zope 2.11, you should use event subscribers instead, and meanwhile mark the class with DeprecationWarning) /opt/Plone-2.5/lib/python/OFS/subscribers.py:74: DeprecationWarning: Products.kupu.plone.plonelibrarytool.PloneKupuLibraryTool.manage_afterAdd is deprecated and will be removed in Zope 2.11, you should use event subscribers instead, and meanwhile mark the class with DeprecationWarning) /opt/Plone-2.5/Instance/Products/Marshall/config.py:33: DeprecationWarning: The zLOG package is deprecated and will be removed in Zope 2.11. Use the Python logging module instead. LOG('Marshall', level, msg)

So first off, how do we supress these errors that are presumably using the logging module?

Secondly how about using the power of the internet and making a web page that describes what to do. I don’t know what marking the class actually means, but I’m sure if someone put up a page explaining it, and a link we could figure it out eg:

Products.kupu.plone.plonelibrarytool.PloneKupuLibraryTool.manage_afterAdd is deprecated see http://blogs.nuxeo.com/sections/blogs/florent_guillaume/2005_11_08_events-in-zope-2-9

(which btw the way is a useful blog post on the subject, hiding down there in the Google results)

Do I really need to see all this? Can we put this into a unit test that will do something like test –show-deprecations? Deprecation warnings in products I develop are useful, but I fear, I like most or just ignoring these logs. If that’s the case we are losing the battle.