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

TypeError: LockedJSONData.__init__() got an unexpected keyword argument 'lock_file' ; presumably related to unpinned filelock dep #654

Open
wyattscarpenter opened this issue Jun 22, 2024 · 2 comments

Comments

@wyattscarpenter
Copy link

Platform

Operating system and version: Windows 10, latest
Legendary version (legendary -V): legendary version "0.20.34", codename "Direct Intervention"

C:\Users\wyatt>legendary list
[cli] INFO: Logging in...
Exception ignored in: <function BaseFileLock.__del__ at 0x000001DD246668E0>
Traceback (most recent call last):
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\site-packages\filelock\_api.py", line 400, in __del__
    self.release(force=True)
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\site-packages\filelock\_api.py", line 361, in release
    if self.is_locked:
       ^^^^^^^^^^^^^^
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\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\wyatt\AppData\Local\Programs\Python\Python312\Scripts\legendary.exe\__main__.py", line 7, in <module>
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\site-packages\legendary\cli.py", line 3060, in main
    cli.list_games(args)
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\site-packages\legendary\cli.py", line 191, in list_games
    if not self.core.login():
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\site-packages\legendary\core.py", line 253, in login
    with self.lgd.userdata_lock as lock:
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\wyatt\AppData\Local\Programs\Python\Python312\Lib\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\wyatt\AppData\Local\Programs\Python\Python312\Lib\site-packages\filelock\_api.py", line 137, in __call__
    instance = super().__call__(**init_params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: LockedJSONData.__init__() got an unexpected keyword argument 'lock_file'

since this takes place in filelock, and they've been making some related changes lately... probably related to that https://github.com/tox-dev/filelock/releases

@wyattscarpenter
Copy link
Author

I'm using Python 3.12.3, by the way.

@kloon15
Copy link

kloon15 commented Jun 22, 2024

Fixed in #656

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