I am still getting this error on the latest lxml 3.4.1 on Python 3.4.0.
lxml.etree: (3, 4, 1, 0) libxml used: (2, 9, 1) libxml compiled: (2, 9, 1) libxslt used: (1, 1, 28) libxslt compiled: (1, 1, 28) Traceback (most recent call last): File "test.py", line 24, in <module> cleaned = cleaner.clean_html(html_string) File "/home/milorad/envs/hiri-py3/lib/python3.4/site-packages/lxml/html/clean.py", line 504, in clean_html self(doc) File "/home/milorad/envs/hiri-py3/lib/python3.4/site-packages/lxml/html/clean.py", line 262, in __call__ for aname in attrib.keys(): RuntimeError: dictionary changed size during iteration
This should simply be a matter of iterating over list(attrib.keys()) here: https://github.com/lxml/lxml/blob/50a8cbbb4fb35a794977c3d8ecc43ddac4f4413e/src/lxml/html/clean.py#L271
And possibly here: https://github.com/lxml/lxml/blob/50a8cbbb4fb35a794977c3d8ecc43ddac4f4413e/src/lxml/html/clean.py#L262
I am still getting this error on the latest lxml 3.4.1 on Python 3.4.0.
lxml.etree: (3, 4, 1, 0) clean_html( html_string) milorad/ envs/hiri- py3/lib/ python3. 4/site- packages/ lxml/html/ clean.py" , line 504, in clean_html milorad/ envs/hiri- py3/lib/ python3. 4/site- packages/ lxml/html/ clean.py" , line 262, in __call__
libxml used: (2, 9, 1)
libxml compiled: (2, 9, 1)
libxslt used: (1, 1, 28)
libxslt compiled: (1, 1, 28)
Traceback (most recent call last):
File "test.py", line 24, in <module>
cleaned = cleaner.
File "/home/
self(doc)
File "/home/
for aname in attrib.keys():
RuntimeError: dictionary changed size during iteration
This should simply be a matter of iterating over list(attrib.keys()) here: /github. com/lxml/ lxml/blob/ 50a8cbbb4fb35a7 94977c3d8ecc43d dac4f4413e/ src/lxml/ html/clean. py#L271
https:/
And possibly here: /github. com/lxml/ lxml/blob/ 50a8cbbb4fb35a7 94977c3d8ecc43d dac4f4413e/ src/lxml/ html/clean. py#L262
https:/