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

Python import guessit fails #792

Open
iditude opened this issue Dec 11, 2024 · 2 comments
Open

Python import guessit fails #792

iditude opened this issue Dec 11, 2024 · 2 comments

Comments

@iditude
Copy link

iditude commented Dec 11, 2024

Hello, I just upgraded my ubuntu box to 24.10 which I guess updated Python to 3.12.

I can't import guessit anymore as I get a straight error below just by doing a very simple import.

Any ideas?

Thanks a lot!

`Python 3.12.7 (main, Nov 6 2024, 18:29:01) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import guessit
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/guessit/init.py", line 8, in
from .api import guessit, GuessItApi
File "/usr/lib/python3/dist-packages/guessit/api.py", line 17, in
from .rules import rebulk_builder
File "/usr/lib/python3/dist-packages/guessit/rules/init.py", line 11, in
from .properties.episodes import episodes
File "/usr/lib/python3/dist-packages/guessit/rules/properties/episodes.py", line 16, in
from .title import TitleFromPosition
File "/usr/lib/python3/dist-packages/guessit/rules/properties/title.py", line 11, in
from .language import (
File "/usr/lib/python3/dist-packages/guessit/rules/properties/language.py", line 77, in
NON_SPECIFIC_LANGUAGES = frozenset([UNDETERMINED, MULTIPLE])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/babelfish/language.py", line 155, in hash
return hash(str(self))
^^^^^^^^^
File "/usr/lib/python3/dist-packages/babelfish/language.py", line 178, in str
s = self.alpha2
^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/babelfish/language.py", line 150, in getattr
return language_converters[name].convert(alpha3, country, script)
~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/lib/python3/dist-packages/babelfish/converters/init.py", line 243, in getitem
for ep in iter_entry_points(self.entry_point):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/babelfish/compat.py", line 28, in iter_entry_points
return entry_points().select(group=group, **kwargs)
^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/init.py", line 913, in entry_points
return EntryPoints(eps).select(**params)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/init.py", line 911, in
dist.entry_points for dist in _unique(distributions())
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/init.py", line 835, in _normalized_name
or super().normalized_name
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/init.py", line 462, in normalized_name
return Prepared.normalize(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/init.py", line 762, in normalize
return re.sub(r"[-
.]+", "-", name).lower().replace('-', '
')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/re/init.py", line 186, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'`

@iditude
Copy link
Author

iditude commented Dec 15, 2024

Specifying here my modules version. I am on guessit 3.8.0

acme==2.9.0 aiodns==3.2.0 aiohttp==3.9.5 aioredis==1.3.1 aiosignal==1.3.1 aiosqlite==0.20.0 annotated-types==0.7.0 apprise==1.8.1 argcomplete==3.4.0 arrow==1.3.0 async-timeout==4.0.3 attrs==23.2.0 autocommand==2.2.2 b2sdk==2.4.1 Babel==2.14.0 babelfish==0.6.1 bcc==0.30.0 bcrypt==4.2.0 beautifulsoup4==4.12.3 blinker==1.8.2 boto3==1.34.46 botocore==1.34.46 Brlapi==0.8.5 certbot==2.9.0 certbot-apache==2.9.0 certifi==2024.6.2 changedetection.io==0.46.4 chardet==5.2.0 cheroot==10.0.0+ds1 CherryPy==18.9.0 click==8.1.7 cloud-init==24.3.1 colorama==0.4.6 command-not-found==0.3 ConfigArgParse==1.7 configobj==5.0.8 cryptography==42.0.5 cssselect==1.2.0 CT3==3.3.3 cupshelpers==1.0 dbus-python==1.3.2 defer==1.0.6 Deprecated==1.2.14 distro==1.9.0 distro-info==1.9 duplicity==2.1.4 exceptiongroup==1.2.2 fail2ban==1.1.0 fasteners==0.18 feedparser==6.0.11 frozenlist==1.4.1 gpg==1.18.0 guessit==3.8.0 h11==0.14.0 hiredis==2.3.2 html5lib==1.1 httplib2==0.22.0 idna==3.6 importlib_metadata==8.2.0 inflect==7.3.1 jaraco.collections==5.0.1 jaraco.context==6.0.0 jaraco.functools==4.0.2 jaraco.text==4.0.0 Jinja2==3.1.3 jmespath==1.0.1 josepy==1.14.0 jq==1.8.0 jsonpatch==1.32 jsonpointer==2.0 jsonschema==4.19.2 jsonschema-specifications==2023.12.1 language-selector==0.1 launchpadlib==2.0.0 lazr.restfulclient==0.14.6 lazr.uri==1.0.6 libvirt-python==10.6.0 logfury==1.0.1 louis==3.30.0 lxml==5.3.0 Mako==1.3.5.dev0 Markdown==3.6 markdown-it-py==3.0.0 MarkupSafe==2.1.5 mdurl==0.1.2 monotonic==1.6 more-itertools==10.3.0 multidict==6.0.5 netaddr==0.10.1 netifaces==0.11.0 notify2==0.3 oauthlib==3.2.2 olefile==0.46 outcome==1.2.0 packaging==24.1 paramiko==3.4.0 parsedatetime==2.6 pexpect==4.9.0 pillow==10.4.0 pipx==1.6.0 platformdirs==4.2.2 portend==3.2.0 postfix-mta-sts-resolver==1.1.2 psutil==5.9.8 ptyprocess==0.7.0 puremagic==1.25 pyasyncore==1.0.2 pycairo==1.26.1 pycares==4.4.0 pycups==2.0.4 pyee==12.0.0 Pygments==2.18.0 PyGObject==3.48.2 PyICU==2.13.1 pyinotify==0.9.6 PyJWT==2.7.0 PyNaCl==1.5.0 pyOpenSSL==24.2.1 pyparsing==3.1.2 pyppeteer-ng==2.0.0rc5 pyppeteerstealth==0.0.5 pyRFC3339==1.1 pyserial==3.5 PySocks==1.7.1 pytest==7.4.4 pytest-flask==1.3.0 python-apt==2.9.0+ubuntu1 python-augeas==0.5.0 python-dateutil==2.9.0 python-debian==0.1.49+ubuntu3 pytz==2024.1 pyxdg==0.28 PyYAML==6.0.2 rebulk==3.3.0 redis==4.3.4 referencing==0.35.1 repoze.lru==0.7 requests==2.32.3 requests-file==2.1.0 requests-oauthlib==1.3.1 rich==13.7.1 Routes==2.5.1 rpds-py==0.20.0 s3transfer==0.10.1 sabctools==8.2.3 selenium==4.14.0 setuptools==74.1.2 sgmllib3k==1.0.0 simplejson==3.19.2 six==1.16.0 sniffio==1.3.1 sortedcontainers==2.4.0 soupsieve==2.6 speedtest-cli==2.1.3 ssh-import-id==5.11 systemd-python==235 tempora==5.5.1 timeago==1.0.16 toposort==1.10 trio==0.24.0 trio-websocket==0.11.1 typeguard==4.3.0 typing_extensions==4.12.2 ubuntu-drivers-common==0.0.0 ubuntu-pro-client==8001 ufw==0.36.2 ujson==5.10.0 unattended-upgrades==0.1 urllib3==1.26.19 usb-creator==0.3.16 userpath==1.9.1 uvloop==0.19.0 validators==0.34.0 wadllib==1.3.6 webencodings==0.5.1 WebOb==1.8.7 websocket-client==1.7.0 Werkzeug==3.0.4 wheel==0.44.0 wrapt==1.15.0 wsproto==1.2.0 WTForms==3.1.2 xdg==5 xkit==0.0.0 yarl==1.9.4 zc.lockfile==3.0.post1 zipp==3.20.0

Thanks a lot!

@iditude
Copy link
Author

iditude commented Dec 15, 2024

Answering to myself, looks like packages from Ubuntu use an old version of Guessit. https://launchpad.net/ubuntu/+source/guessit. The package was done before Guessit 3.8.0 was released but still this is the version numbers it shows. very confusing version system.

So I guess I need to wait for Ubuntu to package the new version.. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant