guessit-io / guessit

GuessIt is a python library that extracts as much information as possible from a video filename.
https://guessit-io.github.io/guessit
GNU Lesser General Public License v3.0
824 stars 91 forks source link

`DeprecationWarning`'s in Python 3.11 #749

Closed Safihre closed 11 months ago

Safihre commented 1 year ago

Has nobody reported this? If you run with python -X dev it shows 3 DeprecationWarning's in guessit:

C:\xx\sabnzbd\venv\Lib\site-packages\guessit\options.py:148: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  default_options_data = read_text('guessit.config', 'options.json')

C:\Program Files\Python311\Lib\importlib\resources\_legacy.py:80: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with open_text(package, resource, encoding, errors) as fp:

C:\xx\sabnzbd\venv\Lib\site-packages\guessit\rules\properties\website.py:34: DeprecationWarning: pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
  with files('guessit.data') as data_files:
Safihre commented 1 year ago

Also, just the import guessit also results in these:

C:\xx\sabnzbd\venv\Lib\site-packages\pkg_resources\__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
  warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
C:\xx\sabnzbd\venv\Lib\site-packages\pkg_resources\__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zc')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
Safihre commented 11 months ago

Seems recent PR merges fixed it 👍