Windows: Fixed FileNotFoundError when copying dependencies to the project folder #285
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.
If you copy the dll files to the project folder. It will throw a FileNotFoundError because of the default CDLL mode(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS).
It expects a full path to the file but for some reason ctypes.util.find_library only returns the file name if its in the project directory next to the mpv.py. Thats why the workaround(#60 (comment)) putting the dependencies in the script folder works since it returns the full path.
Adding winmode=0 fixes this issue and the user can now put the dependencies in the project directory or in the script folder.
For unit tests you would need to copy the dependencies in the tests folder as well.
It might be better to use a different approach to find the dll but this might be enough since it shouldn't break anything if it does let me know.
Closes #104