Repository navigation
fix: hooks not loading on python 3.13 - #759
Closed
sudoAlphaX wants to merge 2 commits into
Closed
sudoAlphaX wants to merge 2 commits into
sudoAlphaX wants to merge 2 commits into
Conversation
FichteFoll
reviewed
Feb 23, 2025
sudoAlphaX
marked this pull request as draft
February 24, 2025 14:33
Hooks refuse to load on python version 3.13 because of the error
`AttributeError: 'FileFinder' object has no attribute 'find_module'`
This patch changes find_module to importlib.import_module() to fix this issue. I have
tested it using python version 3.8 and 3.13.
Here is the full trace before this patch:
```py
Engine: Reading config files...
Data: Initializing...
libanilist: Initializing...
Data: Using libanilist (anime)
Engine: Parsing redirection file...
Engine: Scanning local library...
Engine: Importing user hooks...
Traceback (most recent call last):
File "/usr/bin/trackma", line 8, in <module>
sys.exit(main())
~~~~^^
File "/usr/lib/python3.13/site-packages/trackma/ui/cli.py", line 1071, in main
main_cmd.start()
~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/trackma/ui/cli.py", line 180, in start
self.engine.start()
~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/trackma/engine.py", line 305, in start
module = loader.find_module(name).load_module(name)
^^^^^^^^^^^^^^^^^^
AttributeError: 'FileFinder' object has no attribute 'find_module'
```
Co-Authored-By: FichteFoll <fichtefoll2@googlemail.com>
Author
|
@FichteFoll something like this would do? |
sudoAlphaX
marked this pull request as ready for review
February 24, 2025 14:42
Contributor
|
I'll have to look into this in more detail to evaluate whether it is worth abandoning the |
Author
|
Shall i instead abandon using pkgutil and use only importlib (and os.listdir) |
Contributor
|
After some research I am confident that #769 is the proper way to do this now, so I'm closing this PR as a duplicate. Thanks for taking a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hooks refuse to load on python version 3.13 because of the error
AttributeError: 'FileFinder' object has no attribute 'find_module'This patch changes find_module to find_spec to fix this issue. I have
tested it using python version 3.8 and 3.13.
Here is the full trace before this patch:
Fixes #736.
Duplicates and closes #746.