iamkroot / trakt-scrobbler

Scrobbler for trakt.tv that supports VLC, Plex, MPC-HC, and MPV.
https://github.com/iamkroot/trakt-scrobbler/wiki
GNU General Public License v2.0
464 stars 30 forks source link

[BUG] Python 3.12 uncaught exceptions #268

Closed Sp3EdeR closed 11 months ago

Sp3EdeR commented 11 months ago

The log contains many uncaught exceptions about trying to spawn threads during thread shutdown, including from the uncaught exception handler.

A clear and concise description of what the bug/error is.

Desktop (please complete the following information):

Just start playing anything, the exceptions will happen instantly.

Steps to reproduce the behavior:

  1. Open any file
  2. Play
  3. See the error in log file

Log file extract

Click to see log contents

``` 2023-12-24 21:43:19,644 - ERROR - scrobbler - __init__ - Unhandled exception Traceback (most recent call last): File "C:\Program Files (x86)\Fejlesztői Eszközök\Python\Lib\threading.py", line 1052, in _bootstrap_inner self.run() File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\scrobbler.py", line 36, in run self.scrobble(verb, data) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\scrobbler.py", line 80, in scrobble self.handle_successful_scrobble(verb, data, resp) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\scrobbler.py", line 72, in handle_successful_scrobble notify(msg, category=f"scrobble.{category}", actions=(action,)) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\notifier.py", line 126, in notify toaster.show_toast(title, body, duration=timeout, threaded=True) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\win10toast\__init__.py", line 134, in show_toast self._thread.start() File "C:\Program Files (x86)\Fejlesztői Eszközök\Python\Lib\threading.py", line 971, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't create new thread at interpreter shutdown 2023-12-24 21:43:19,645 - ERROR - scrobbler - __init__ - Exception while notifying user. Traceback (most recent call last): File "C:\Program Files (x86)\Fejlesztői Eszközök\Python\Lib\threading.py", line 1052, in _bootstrap_inner self.run() File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\scrobbler.py", line 36, in run self.scrobble(verb, data) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\scrobbler.py", line 80, in scrobble self.handle_successful_scrobble(verb, data, resp) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\scrobbler.py", line 72, in handle_successful_scrobble notify(msg, category=f"scrobble.{category}", actions=(action,)) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\notifier.py", line 126, in notify toaster.show_toast(title, body, duration=timeout, threaded=True) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\win10toast\__init__.py", line 134, in show_toast self._thread.start() File "C:\Program Files (x86)\Fejlesztői Eszközök\Python\Lib\threading.py", line 971, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't create new thread at interpreter shutdown During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\__init__.py", line 21, in error_logger notify(f"Check log file.\n{exc_info[1]}", "Unhandled Exception", File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\notifier.py", line 126, in notify toaster.show_toast(title, body, duration=timeout, threaded=True) File "C:\ProgramData\pipx\venvs\trakt-scrobbler\Lib\site-packages\win10toast\__init__.py", line 134, in show_toast self._thread.start() File "C:\Program Files (x86)\Fejlesztői Eszközök\Python\Lib\threading.py", line 971, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't create new thread at interpreter shutdown ```

Sp3EdeR commented 11 months ago

For additional details, see the python check being added: https://github.com/python/cpython/commit/ce558e69d4087dd3653207de78345fbb8a2c7835#diff-8b4c7f5f9b60a27c4132899af6fa7157c7f1e57a0b6213bc616fe72fba04c168R1038

iamkroot commented 11 months ago

Hmm, this is a weird one- I'm not sure where the "Interpreter Shutdown" comes from- all we do is start a timer 😓 Will need some time to debug