Re: [Zope] PageTemplates len() of unsized object
Giampiero Benvenuti wrote at 2008-5-24 11:47 +0200: ... after the upgrade from zope2.9.7 to 2.10.6 i get this error in the event log: 2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module Shared.DC.Scripts.Bindings, line 313, in __call__ Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 129, in _exec Module Products.PageTemplates.PageTemplate, line 89, in pt_render Module zope.pagetemplate.pagetemplate, line 117, in pt_render Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 379, in do_startEndTag Module zope.tal.talinterpreter, line 412, in do_startTag TypeError: len() of unsized object Looks as if the Zope 2.10 PageTemplate implementation made a big step backward with respect to quality of traceback information :-(( Shane had added lots of __traceback_info__ and __traceback_supplement__ declarations to the older code such that the tracebacks were very informative ... unlike the traceback above. Looking at the code of do_startTag, I see that the problem is with an attribute definition in a start tag. Such an attribute definition should be evaluated into a sequence of strings (or unicode strings). The error happens because one of these sequence elements is not a string, more precisely, it is something len(...) cannot be applied to. Unfortunately, we would need to know the affected template, the template line this problems occurs in (and its code) and the attribute causing this problem. It would be Zope's task to provide this information -- but as I have said: it apparently made big steps backward with Zope 2.10 You could try to add __traceback_info__ = name, item, rendered, s before line 412 of zope/tal/talinterpreter.py. The traceback would then tell us: the name of the tag (name), the attribute definition (item), its evaluation (rendered) and the problematic element. We still would not know which PageTemplate causes the problem (but we might guess this). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PageTemplates len() of unsized object
Thanks Dieter, I was able to solve the problem by uninstalling all the products. By trial and error I found out the problem was caused by the Placeless Translation Service product. Maybe there was some dependency from something else; I can't tell. I just got rid of it and now everything works as normal. Thanks anyhow, Giampiero On May 28, 2008, at 8:48 PM, Dieter Maurer wrote: Giampiero Benvenuti wrote at 2008-5-24 11:47 +0200: ... after the upgrade from zope2.9.7 to 2.10.6 i get this error in the event log: 2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module Shared.DC.Scripts.Bindings, line 313, in __call__ Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 129, in _exec Module Products.PageTemplates.PageTemplate, line 89, in pt_render Module zope.pagetemplate.pagetemplate, line 117, in pt_render Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 379, in do_startEndTag Module zope.tal.talinterpreter, line 412, in do_startTag TypeError: len() of unsized object Looks as if the Zope 2.10 PageTemplate implementation made a big step backward with respect to quality of traceback information :-(( Shane had added lots of __traceback_info__ and __traceback_supplement__ declarations to the older code such that the tracebacks were very informative ... unlike the traceback above. Looking at the code of do_startTag, I see that the problem is with an attribute definition in a start tag. Such an attribute definition should be evaluated into a sequence of strings (or unicode strings). The error happens because one of these sequence elements is not a string, more precisely, it is something len(...) cannot be applied to. Unfortunately, we would need to know the affected template, the template line this problems occurs in (and its code) and the attribute causing this problem. It would be Zope's task to provide this information -- but as I have said: it apparently made big steps backward with Zope 2.10 You could try to add __traceback_info__ = name, item, rendered, s before line 412 of zope/tal/talinterpreter.py. The traceback would then tell us: the name of the tag (name), the attribute definition (item), its evaluation (rendered) and the problematic element. We still would not know which PageTemplate causes the problem (but we might guess this). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PageTemplates len() of unsized object
--On 24. Mai 2008 11:47:32 +0200 Giampiero Benvenuti [EMAIL PROTECTED] wrote: Hello list, after the upgrade from zope2.9.7 to 2.10.6 i get this error in the event log: 2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module Shared.DC.Scripts.Bindings, line 313, in __call__ Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 129, in _exec Module Products.PageTemplates.PageTemplate, line 89, in pt_render Module zope.pagetemplate.pagetemplate, line 117, in pt_render Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 379, in do_startEndTag Module zope.tal.talinterpreter, line 412, in do_startTag TypeError: len() of unsized object If I click on ZMI error_log i just get: Error Type: TypeError Error Value: len() of unsized object You might take the Python debugger and figure out why do_startTag() is failing. This might help us for providing a fix or a workaround. Without further information e.g. the related content of the template or the related tag failing here...there is little we can do - except guessing (I won't). Andreas pgpvSO5pKqR5y.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PageTemplates len() of unsized object
Thanks Andreas, unfortunately, your advice to use Python debugger is way over my head. I'm a web designer, I can deal with Zope and python up to some level (medium/low?)...sometime with Zope even the level of knowledge of it is openable :-( Thanks anyhow, Giampiero On May 24, 2008, at 11:52 AM, Andreas Jung wrote: --On 24. Mai 2008 11:47:32 +0200 Giampiero Benvenuti [EMAIL PROTECTED] wrote: Hello list, after the upgrade from zope2.9.7 to 2.10.6 i get this error in the event log: 2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module Shared.DC.Scripts.Bindings, line 313, in __call__ Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 129, in _exec Module Products.PageTemplates.PageTemplate, line 89, in pt_render Module zope.pagetemplate.pagetemplate, line 117, in pt_render Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 379, in do_startEndTag Module zope.tal.talinterpreter, line 412, in do_startTag TypeError: len() of unsized object If I click on ZMI error_log i just get: Error Type: TypeError Error Value: len() of unsized object You might take the Python debugger and figure out why do_startTag() is failing. This might help us for providing a fix or a workaround. Without further information e.g. the related content of the template or the related tag failing here...there is little we can do - except guessing (I won't). Andreas ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )