[Zope-dev] Nasty error message with obscure bug

Chris Withers chris at simplistix.co.uk
Thu Jun 15 14:20:46 EDT 2006


Hi All,

Got this weird error message:
   Module TAL.TALInterpreter, line 701, in translate
   Module Products.PageTemplates.TALES, line 261, in translate
   Module Products.Five.i18n, line 51, in translate
   Module Products.PageTemplates.GlobalTranslationService, line 33, in 
translate
TypeError: expected string or buffer

...and eventually tracked it down to this code:

<meta name="description" content="blah"
       i18n:attributes="description"/>

The bug, of course, is that the i18:attributes should be content, not 
description, which doesn't exist.

This results in a None msgid, which PTS used to do something (I don't 
know whether it was sane or not, no errors) with but which raises the 
rather obscure error above.

I don't know if anything should be done here. Obviously it'd be nice if 
the error message was a bit nicer ("i18:attributes specified attribute 
'description', which did not exist on tag 'meta' in 
/standard_template.pt") but it's a pretty obscure error.

If anyone with greater knowledge could implement the above without much 
pain, that'd be great. In any case, hopefully Google will catch this 
some time and save the next weary traveller who bumps into it a couple 
of hours ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope-Dev mailing list