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

Deprecated distutils module as of Python 3.12 #290

Open
BovBrew opened this issue Nov 20, 2023 · 1 comment
Open

Deprecated distutils module as of Python 3.12 #290

BovBrew opened this issue Nov 20, 2023 · 1 comment

Comments

@BovBrew
Copy link

BovBrew commented Nov 20, 2023

distutils module has been deprecated as of Python 3.12

found in \src\trackers\PTP.py but could be elsewhere in code.

import distutils.util
# Rest of the code...
        self.web_source = distutils.util.strtobool(str(config['TRACKERS']['PTP'].get('add_web_source_to_desc', True)))

This can be replaced with:

from str2bool import str2bool
# Rest of the code...
        self.web_source = str2bool(config['TRACKERS']['PTP'].get('add_web_source_to_desc', True))

pip install str2bool would be required or added to requirments.txt

@sirius-sama
Copy link
Contributor

Are you getting any errors for guessit on v3.12.0?

$ python upload.py -h
Traceback (most recent call last):
  File "/home/user/bin/upload-assistant/src/prep.py", line 21, in <module>
    from guessit import guessit
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/guessit/__init__.py", line 8, in <module>
    from .api import guessit, GuessItApi
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/guessit/api.py", line 17, in <module>
    from .rules import rebulk_builder
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/guessit/rules/__init__.py", line 11, in <module>
    from .properties.episodes import episodes
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/guessit/rules/properties/episodes.py", line 16, in <module>
    from .title import TitleFromPosition
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/guessit/rules/properties/title.py", line 11, in <module>
    from .language import (
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/guessit/rules/properties/language.py", line 10, in <module>
    import babelfish
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/babelfish/__init__.py", line 14, in <module>
    from .converters import (LanguageConverter, LanguageReverseConverter, LanguageEquivalenceConverter, CountryConverter,
  File "/home/user/bin/upload-assistant/.venv/lib/python3.12/site-packages/babelfish/converters/__init__.py", line 5, in <module>
    from pkg_resources import iter_entry_points, EntryPoint
ModuleNotFoundError: No module named 'pkg_resources'
None
Missing Module Found. Please reinstall required dependancies.
pip3 install --user -U -r requirements.txt```

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

2 participants