mnamer doesn't work since python upgrade to 3.13
Ever since Python was update to 3.13 (currently, Python 3.13.1), mnamer won't work. This is the crash report:
============================== CRASH REPORT BEGIN ==============================
--------------------------------- environment ----------------------------------
- date = 2025-01-23
- platform = Linux-6.12.10-arch1-1-x86_64-with-glibc2.40
- arguments = ['--batch', '--episode-format', '{series}/Season {season:02}/{series}.s{season:02}e{episode:02}.{title}.[{date}]{extension}', /TVSeries/']
- cache location = /home/bruno/.cache/mnamer-py3.13.sqlite
- python version = 3.13.1
- mnamer version = 2.5.6.dev3
- appdirs version = 1.4.4
- guessit version = 3.7.1
- requests version = 2.32.3
- requests cache version = 0.9.8
- teletype version = 1.3.4
--------------------------------- stack trace ----------------------------------
Traceback (most recent call last): File "/home/user/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/api.py", line 200, in guessit config = self.configure(options, sanitize_options=False) File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/api.py", line 175, in configure self.rebulk = rules_builder(advanced_config) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/rules/init.py", line 62, in rebulk_builder rebulk.rebulk(website(_config('website'))) ~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/rules/properties/website.py", line 34, in website with files('guessit.data') as data_files: ~~~~~^^^^^^^^^^^^^^^^ TypeError: 'PosixPath' object does not support the context manager protocol
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/mnamer/main.py", line 22, in main frontend = Cli(settings) File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/mnamer/frontends.py", line 68, in init super().init(settings) ~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/mnamer/frontends.py", line 24, in init self.targets = Target.populate_paths(self.settings) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/mnamer/target.py", line 66, in populate_paths targets = [cls(file_path, settings) for file_path in file_paths] ~~~^^^^^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/mnamer/target.py", line 49, in init self._parse(file_path) ~~~~~~~~~~~^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/mnamer/target.py", line 126, in _parse raw_data = dict(guessit(str(file_path), options)) ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/api.py", line 74, in guessit return default_api.guessit(string, options) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/api.py", line 225, in guessit raise GuessitException(string, options) from err guessit.api.GuessitException: An internal error has occurred in guessit. ===================== Guessit Exception Report ===================== version=3.7.1 string=/media/trabalho/Videos/TVSeries/A Teacher.s01e01.[2020.11.10].mp4 options={'type': None, 'language': None}
Traceback (most recent call last): File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/api.py", line 200, in guessit config = self.configure(options, sanitize_options=False) File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/api.py", line 175, in configure self.rebulk = rules_builder(advanced_config) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/rules/init.py", line 62, in rebulk_builder rebulk.rebulk(website(_config('website'))) ~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/home/bruno/.local/share/pipx/venvs/mnamer/lib/python3.13/site-packages/guessit/rules/properties/website.py", line 34, in website with files('guessit.data') as data_files: ~~~~~^^^^^^^^^^^^^^^^ TypeError: 'PosixPath' object does not support the context manager protocol
Please report at https://github.com/guessit-io/guessit/issues.
=============================== CRASH REPORT END ===============================
Dang, it looks like mnamer crashed! Please consider filling an issue at https://github.com/jkwill87/mnamer/issues along with this report.
[
FYI, looks like this may have been fixed with guessit==3.8.0
https://github.com/guessit-io/guessit/releases
Looks like the project is a bit dead so not sure if this will be fixed. Anyone know a simple patch I can apply to get things working?
@Jackojc if you install mnamer using uv you can use python 3.12 quite easily and then this issue does not apply.
uv python install 3.12
uv tool install --python=3.12 mnamer
uv run mnamer --help
If you need help installing uv check out these docs https://docs.astral.sh/uv/getting-started/installation/
pipx runpip mnamer install guessit==3.8.0