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

'MediaManager' object has no attribute 'close' #157

Open
liasfurl opened this issue Jan 4, 2023 · 2 comments
Open

'MediaManager' object has no attribute 'close' #157

liasfurl opened this issue Jan 4, 2023 · 2 comments

Comments

@liasfurl
Copy link

liasfurl commented Jan 4, 2023

Getting this error, caused by the close call on collection.py:70 in Anki 2.1.54 and 2.1.55, both Qt6. Commenting out this line lets the sync work again, thought I'm not sure what the consequences of not closing the default media manager are.

@szotsaki
Copy link

Are you sure is it in collection.py:70? Line 70 seems to be an import function.

@szotsaki
Copy link

The error log itself:

[2023-01-26 22:57:29,982]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/hostKey HTTP/1.1" 200 43
[2023-01-26 22:57:30,017]:INFO:ankisyncd.CollectionThread[...]:Starting...
[2023-01-26 22:57:30,018]:INFO:ankisyncd.CollectionThread[...]:Running meta(*[], **{'v': 10, 'cv': 'anki,2.1.56 (07fd88dd),...'})
[2023-01-26 22:57:30,021]:ERROR:ankisyncd.CollectionThread[...]:Unable to meta(*[], **{'v': 10, 'cv': 'anki,2.1.56 (07fd88dd),...'}): 'MediaManager' object has no attribute 'close'
Traceback (most recent call last):
  File ".../anki-sync-server/src/ankisyncd/thread.py", line 106, in _run
    ret = self.wrapper.execute(func, args, kw, return_queue)
  File ".../anki-sync-server/src/ankisyncd/collection/wrapper.py", line 39, in execute
    self.open()
  File ".../anki-sync-server/src/ankisyncd/collection/wrapper.py", line 75, in open
    self.__col = self._get_collection()
  File ".../anki-sync-server/src/ankisyncd/collection/wrapper.py", line 66, in _get_collection
    col.media.close()
  File "/usr/lib64/python3.10/site-packages/anki/_legacy.py", line 80, in __getattr__
    raise AttributeError(
AttributeError: 'MediaManager' object has no attribute 'close'
Traceback (most recent call last):
  File "/usr/lib64/python3.10/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File ".../anki-sync-server/src/ankisyncd/sync_app.py", line 585, in __call__
    w = self.__wrapped__(*args, **kwargs)
  File ".../anki-sync-server/src/ankisyncd/sync_app.py", line 740, in __call__
    result = self._execute_handler_method_in_thread(url, data, session)
  File ".../anki-sync-server/src/ankisyncd/sync_app.py", line 805, in _execute_handler_method_in_thread
    result = thread.execute(run_func, kw=keyword_args)
  File ".../anki-sync-server/src/ankisyncd/thread.py", line 82, in execute
    raise ret
  File ".../anki-sync-server/src/ankisyncd/thread.py", line 106, in _run
    ret = self.wrapper.execute(func, args, kw, return_queue)
  File ".../anki-sync-server/src/ankisyncd/collection/wrapper.py", line 39, in execute
    self.open()
  File ".../anki-sync-server/src/ankisyncd/collection/wrapper.py", line 75, in open
    self.__col = self._get_collection()
  File ".../anki-sync-server/src/ankisyncd/collection/wrapper.py", line 66, in _get_collection
    col.media.close()
  File "/usr/lib64/python3.10/site-packages/anki/_legacy.py", line 80, in __getattr__
    raise AttributeError(
AttributeError: 'MediaManager' object has no attribute 'close'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants