Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError on images withour src attribute #11

Closed
hvelarde opened this issue Apr 6, 2016 · 0 comments · Fixed by #12
Closed

KeyError on images withour src attribute #11

hvelarde opened this issue Apr 6, 2016 · 0 comments · Fixed by #12
Labels

Comments

@hvelarde
Copy link
Member

hvelarde commented Apr 6, 2016

Seems that under some weird circumstances there can be img tags without src attributes; we need to gracefully handle this exception and point to the object responsible of this situation:

2016-04-06T01:18:39 ERROR plone.transformchain Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/cartacapital/cartacapital.portal.buildout/eggs/plone.transformchain-1.0.3-py2.7.egg/plone/transformchain/transformer.py", line 48, in __call__
    newResult = handler.transformIterable(result, encoding)
  File "/home/cartacapital/cartacapital.portal.buildout/eggs/collective.lazysizes-1.4.0a1-py2.7.egg/collective/lazysizes/transform.py", line 103, in transformIterable
    self._lazyload(el)
  File "/home/cartacapital/cartacapital.portal.buildout/eggs/collective.lazysizes-1.4.0a1-py2.7.egg/collective/lazysizes/transform.py", line 57, in _lazyload
    element.attrib['data-src'] = element.attrib['src']
  File "lxml.etree.pyx", line 2200, in lxml.etree._Attrib.__getitem__ (src/lxml/lxml.etree.c:49210)
KeyError: 'src'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant