You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sanitizer and lxml tree walker: TypeError: unhashable type #68
What is the expected output? What do you see instead?
I do not know exactly what should be printed. Instead, an exception is raised:
$ python t.py
{'namespace': u'None', 'type': 'Characters', 'data': u'<body>'}
Traceback (most recent call last):
File "t.py", line 17, in <module>
for token in stream:
File "/home/radek/.virtualenvs/blog/local/lib/python2.7/site-packages/html5lib-0.95-py2.7.egg/html5lib/filters/sanitizer.py", line 7, in __iter__
token = self.sanitize_token(token)
File "/home/radek/.virtualenvs/blog/local/lib/python2.7/site-packages/html5lib-0.95-py2.7.egg/html5lib/sanitizer.py", line 171, in sanitize_token
token["data"][::-1]
TypeError: unhashable type
Please provide any additional information below.
the faulty token is:
{'namespace': u'None ',' type ':' StartTag ',' name ': u'h1', 'data': {}}
Activity
gsnedders commentedon Jun 21, 2013
At first glance, this is the manifestation of the sanitizer trying to handle tokenizer and treewalker tokens at once.
gsnedders commentedon Jun 21, 2013
Dupe of #72.