Cih2001 / KodiSubsceneAddon

This is an addon for kodi to download subtitles from subscene.com
13 stars 9 forks source link

Broken for python >= 3.10 #10

Open pejobo opened 2 years ago

pejobo commented 2 years ago

I know the plugin is currently broken due to changes on the subscene website (see #9 and #8) what is really sad.

But if this is fixed the plugin is also currently broken for python 3.10 or newer because the types Mappings and MutableMapping now only sit in package collections.abc, not in collections.

The fix is small, just use these snippet for importin:

try:
    from collections import Mapping
except ImportError:
    from collections.abc import Mapping

(for file lib/html5lib/_trie/_base.py)

try:
    from collections import MutableMapping
except ImportError:
    from collections.abc import MutableMapping

(for file lib/html5lib/treebuilders/dom.py)

Maybe you can incorporate these changes when updating the plugin.

iAYMANi commented 2 years ago

I know the plugin is currently broken due to changes on the subscene website (see #9 and #8) what is really sad.

But if this is fixed the plugin is also currently broken for python 3.10 or newer because the types Mappings and MutableMapping now only sit in package collections.abc, not in collections.

The fix is small, just use these snippet for importin:

try:
    from collections import Mapping
except ImportError:
    from collections.abc import Mapping

(for file lib/html5lib/_trie/_base.py)

try:
    from collections import MutableMapping
except ImportError:
    from collections.abc import MutableMapping

(for file lib/html5lib/treebuilders/dom.py)

Maybe you can incorporate these changes when updating the plugin.

Can you provide a complete file?