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

Literally does not work with Windows paths. #300

Open
FlawlessCasual17 opened this issue Nov 22, 2024 · 0 comments
Open

Literally does not work with Windows paths. #300

FlawlessCasual17 opened this issue Nov 22, 2024 · 0 comments

Comments

@FlawlessCasual17
Copy link

When I attempt to utilize mnamer within an MS Windows environment, I encounter the following error message:

============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2024-11-21
 - platform = Windows-11-10.0.22631-SP0
 - arguments = ['.\\Videos\\Arcane (2021-2024)\\', '-r']
 - cache location = C:\Users\krist\AppData\Local\mnamer-py3.13.sqlite
 - python version = 3.13.0
 - mnamer version = 2.5.5
 - 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 "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\api.py", line 200, in guessit
    config = self.configure(options, sanitize_options=False)
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\api.py", line 175, in configure
    self.rebulk = rules_builder(advanced_config)
                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\rules\__init__.py", line 62, in rebulk_builder
    rebulk.rebulk(website(_config('website')))
                  ~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\rules\properties\website.py", line 34, in website
    with files('guessit.data') as data_files:
         ~~~~~^^^^^^^^^^^^^^^^
TypeError: 'WindowsPath' 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 "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\mnamer\__main__.py", line 22, in main
    frontend = Cli(settings)
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\mnamer\frontends.py", line 68, in __init__
    super().__init__(settings)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\mnamer\frontends.py", line 24, in __init__
    self.targets = Target.populate_paths(self.settings)
                   ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\mnamer\target.py", line 66, in populate_paths
    targets = [cls(file_path, settings) for file_path in file_paths]
               ~~~^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\mnamer\target.py", line 49, in __init__
    self._parse(file_path)
    ~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\mnamer\target.py", line 126, in _parse
    raw_data = dict(guessit(str(file_path), options))
                    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\api.py", line 74, in guessit
    return default_api.guessit(string, options)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\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=C:\Users\krist\Videos\Arcane (2021-2024)\Season 2 (2024)\S02E01\Arcane League of Legends - S02E01 - Heavy is the Crown.eng.sdh.srt
options={'type': None, 'language': None}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\api.py", line 200, in guessit
    config = self.configure(options, sanitize_options=False)
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\api.py", line 175, in configure
    self.rebulk = rules_builder(advanced_config)
                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\rules\__init__.py", line 62, in rebulk_builder
    rebulk.rebulk(website(_config('website')))
                  ~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\krist\scoop\apps\python\current\Lib\site-packages\guessit\rules\properties\website.py", line 34, in website
    with files('guessit.data') as data_files:
         ~~~~~^^^^^^^^^^^^^^^^
TypeError: 'WindowsPath' 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.
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