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

fix: add required arg name for FileLock >=3.15.3 #656

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

kloon15
Copy link
Contributor

@kloon15 kloon15 commented Jun 22, 2024

Updating filelock to >=3.15.3 completely breaks the app with the following error:

PS C:\Users\Kloon> legendary list
[cli] INFO: Logging in...
Exception ignored in: <function BaseFileLock.__del__ at 0x0000020F53924860>
Traceback (most recent call last):
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\filelock\_api.py", line 400, in __del__
    self.release(force=True)
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\filelock\_api.py", line 361, in release
    if self.is_locked:
       ^^^^^^^^^^^^^^
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\filelock\_api.py", line 267, in is_locked
    return self._context.lock_file_fd is not None
           ^^^^^^^^^^^^^
AttributeError: 'LockedJSONData' object has no attribute '_context'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\Scripts\legendary.exe\__main__.py", line 7, in <module>
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\legendary\cli.py", line 3060, in main
    cli.list_games(args)
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\legendary\cli.py", line 191, in list_games
    if not self.core.login():
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\legendary\core.py", line 253, in login
    with self.lgd.userdata_lock as lock:
  File "C:\Program Files\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\legendary\lfs\lgndry.py", line 152, in userdata_lock
    with LockedJSONData(os.path.join(self.path, 'user.json')) as lock:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kloon\AppData\Roaming\Python\Python311\site-packages\filelock\_api.py", line 137, in __call__
    instance = super().__call__(**init_params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: LockedJSONData.__init__() got an unexpected keyword argument 'lock_file'

This PR renames the arg to match the required keyword name.

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

Successfully merging this pull request may close these issues.

2 participants