◐ Shell
clean mode source ↗

Try to import Mapping and MutableMapping from collections.abc by 5j9 · Pull Request #403 · html5lib/html5lib-python

Edit: apologies for the noise, there's already discussion happening about this in #419.

This is now breaking with Python 3.9:

❯ python
Python 3.9.0a2+ (heads/master:b0d4949, Dec 20 2019, 11:38:30)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import html5lib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/site-packages/html5lib/__init__.py", line 25, in <module>
    from .html5parser import HTMLParser, parse, parseFragment
  File "/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/site-packages/html5lib/html5parser.py", line 8, in <module>
    from . import _tokenizer
  File "/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/site-packages/html5lib/_tokenizer.py", line 16, in <module>
    from ._trie import Trie
  File "/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/site-packages/html5lib/_trie/__init__.py", line 3, in <module>
    from .py import Trie as PyTrie
  File "/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/site-packages/html5lib/_trie/py.py", line 6, in <module>
    from ._base import Trie as ABCTrie
  File "/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/site-packages/html5lib/_trie/_base.py", line 3, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/home/pi/.pyenv/versions/3.9-dev/lib/python3.9/collections/__init__.py)