I'm getting an error in CMFCore.utils in the _mergedLocalRoles function. The error is: Exception Type TypeError Exception Value can only concatenate tuple (not "list") to tuple I modify utils.py, after saving a copy, in order to obtain diagnostic output. Then I delete utils.pyc, after saving a copy, in order to force a recompile (even used compilezpy.py for this a couple of times). Zope never seems to use the new version. Also, I added comments ahead of the line where the error occurs so that the line number should be higher than the original error line number. But, it's always the same. I suspect that I have a fundamental misunderstanding of how Zope uses code in the Products directory. Is Zope storing all the compiled byte code in the data.fs file? Is there a way to force Zope to use new code? Also, the previous developer removed the Control Panel putting Plone as the root of everything. How can I get information that the Control Panel usually provides? System: Zope 2.7.1, Plone 2.0.5, Python 2.3.4, Red Hat 7.2 Thank you. Barry Drake The traceback: Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Products.CMFFormController.ControllerPageTemplate, line 80, in __call__ Module Products.CMFFormController.BaseControllerPageTemplate, line 39, in _call Module Products.CMFFormController.ControllerBase, line 243, in getNext Module Products.CMFFormController.Actions.TraverseTo, line 36, in __call__ Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Products.CMFFormController.ControllerPythonScript, line 159, in __call__ Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PythonScripts.PythonScript, line 323, in _exec Module None, line 19, in pag_edit - <ControllerPythonScript at /Plone/pag_edit used for /Plone/Members/bldrake/privLinks.pag> - Line 19 Module Products.CMFDefault.Document, line 192, in edit Module Products.CMFCore.CMFCatalogAware, line 69, in reindexObject Module Products.CMFCore.CatalogTool, line 262, in reindexObject Module Products.CMFCore.CatalogTool, line 235, in catalog_object Module Products.ZCatalog.ZCatalog, line 528, in catalog_object Module Products.ZCatalog.Catalog, line 381, in catalogObject Module Products.PluginIndexes.common.UnIndex, line 240, in index_object Module Products.PluginIndexes.KeywordIndex.KeywordIndex, line 61, in _index_object Module Products.PluginIndexes.KeywordIndex.KeywordIndex, line 94, in _get_object_keywords Module Products.CMFCore.CatalogTool, line 63, in allowedRolesAndUsers THE FOLLOWING ERROR SHOULD BE ON LINE 216 NOW, BUT HASN'T MOVED FROM THE ORIGINAL. Module Products.CMFCore.utils, line 215, in _mergedLocalRoles TypeError: can only concatenate tuple (not "list") to tuple
I modify utils.py, after saving a copy, in order to obtain diagnostic output. Then I delete utils.pyc, after saving a copy, in order to force a recompile (even used compilezpy.py for this a couple of times). Zope never seems to use the new version.
Restart Zope. Python will pick up the changes. Also, if you're modifying security code, make sure you set security-policy-implementation to Python in zope.conf, otherwise you're using the C one, and no matter what changes you make to the Python scripts you won't see any changes.
I suspect that I have a fundamental misunderstanding of how Zope uses code in the Products directory.
Is Zope storing all the compiled byte code in the data.fs file? Is there a way to force Zope to use new code?
No. Refresh the product or restart Zope.
Also, the previous developer removed the Control Panel putting Plone as the root of everything. How can I get information that the Control Panel usually provides?
Find a heavy object, find the developer, bring the two together at speed. Repeat until the problem is fixed. yoursite/manage will get you to the control panel. If he's managed to override /manage then you have problems... And the real problem:
TypeError: can only concatenate tuple (not "list") to tuple
Like it says, you're supplying a list, you want a tuple. It looks like you need to update PluginIndexes, I don't know where they come from. -- Phillip Hutchings http://www.sitharus.com/ sitharus@gmail.com / sitharus@sitharus.com
Barry Drake <bldrake@adaptcs.com> wrote:
I'm getting an error in CMFCore.utils in the _mergedLocalRoles function. The error is:
Exception Type TypeError Exception Value can only concatenate tuple (not "list") to tuple
Note, this problem is due to a non-core product somewhere incorrectly managing local roles, and passing them as tuples instead of lists. All the internals of Zope (and here, CMF) assume that __ac_local_roles__ is a dict of string->list. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (3)
-
Barry Drake -
Florent Guillaume -
Phillip Hutchings