collective / collective.behavior.amp

Support for Accelerated Mobile Pages (AMP) in Plone.
5 stars 2 forks source link

ValueError on AMP HTML transformer #23

Closed hvelarde closed 8 years ago

hvelarde commented 8 years ago

collective.behavior.amp from master branch installed in production raises the following error:

2016-10-06T19:42:32 ERROR Zope.SiteErrorLog 1475793752.730.444929039904 http://example.org/economia/2014/12/12/pac-2-conclui-965-das-obras-e-e-exemplo-para-o-mundo/@@amp
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module collective.behavior.amp.browser, line 47, in __call__
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /.../example.org/eggs/collective.behavior.amp-1.0a2-py2.7.egg/collective/behavior/amp/browser/view.pt
   - Line 190, Column 6
   - Expression: <PathExpr standard:u'view/text'>
   - Names:
      {'args': (),
       'container': <NITF at /Plone/economia/2014/12/12/pac-2-conclui-965-das-obras-e-e-exemplo-para-o-mundo>,
       'context': <NITF at /Plone/economia/2014/12/12/pac-2-conclui-965-das-obras-e-e-exemplo-para-o-mundo>,
       'default': <object object at 0x7fb4658e9500>,
       'here': <NITF at /Plone/economia/2014/12/12/pac-2-conclui-965-das-obras-e-e-exemplo-para-o-mundo>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7fb436a27e68>,
       'request': <HTTPRequest, URL=http://example.org/economia/2014/12/12/pac-2-conclui-965-das-obras-e-e-exemplo-para-o-mundo/@@amp>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7fb453567550>,
       'traverse_subpath': [],
       'user': <SpecialUser 'Anonymous User'>,
       'view': <Products.Five.metaclass.AMPView object at 0x7fb43bc66f90>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7fb436daed50>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 97, in trustedBoboAwareZopeTraverse
  Module zope.traversing.adapters, line 136, in traversePathElement
   - __traceback_info__: (<Products.Five.metaclass.AMPView object at 0x7fb43bc66f90>, 'text')
  Module zope.traversing.adapters, line 42, in traverse
   - __traceback_info__: (<Products.Five.metaclass.AMPView object at 0x7fb43bc66f90>, 'text', [])
  Module collective.behavior.amp.browser, line 233, in text
  Module collective.behavior.amp.utils, line 65, in __call__
  Module collective.behavior.amp.utils, line 35, in transform_img_tags
  Module lxml.etree, line 2161, in lxml.etree._Attrib.__setitem__ (src/lxml/lxml.etree.c:48586)
  Module lxml.etree, line 563, in lxml.etree._setAttributeValue (src/lxml/lxml.etree.c:15481)
  Module lxml.etree, line 1369, in lxml.etree._utf8 (src/lxml/lxml.etree.c:22147)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters