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

theme manager: fix path to assets for PyInstaller on POSIX systems #1191

Closed
wants to merge 1 commit into from

Conversation

rokm
Copy link

@rokm rokm commented Feb 6, 2023

Avoid referencing the assets directory as relative to the customtkinter/windows/widgets/theme, which does not exist in PyInstaller-frozen applications due to python modules being collected into executable-embedded archive.

Relative referencing from non-existant directories, such as customtkinter/windows/widgets/theme/../../../assets does not work on POSIX systems (Linux and macOS) and results in file-not-found errors even though the actual target directory (customtkinter/assets) and its contents exist.

Instead, resolve the top-level customtkinter directoy and its assets sub-directory via the pattern that is found in other parts of the code (i.e., use os.dirname to jump to parent directories from __file__ location).

Avoid referencing the assets directory as relative to the
`customtkinter/windows/widgets/theme`, which does not exist in
PyInstaller-frozen applications due to python modules being
collected into executable-embedded archive.

Relative referencing from non-existant directories, such as
`customtkinter/windows/widgets/theme/../../../assets` does not
work on POSIX systems (Linux and macOS) and results in file-not-found
errors even though the actual target directory (`customtkinter/assets`)
and its contents exist.

Instead, resolve the top-level `customtkinter` directoy and its
assets sub-directory via the pattern that is found in other parts
of the code (i.e., use `os.dirname` to jump to parent directories
from `__file__` location).
@rokm
Copy link
Author

rokm commented Feb 6, 2023

Cross-reference: pyinstaller/pyinstaller-hooks-contrib#542

@rokm
Copy link
Author

rokm commented May 11, 2023

Superseded by 121f571.

@rokm rokm closed this May 11, 2023
@rokm rokm deleted the pyinstaller-posix-fix branch May 11, 2023 20:29
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

Successfully merging this pull request may close these issues.

1 participant