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

loader: prevent local directory from shadowing system library #5182

Merged
merged 2 commits into from Sep 22, 2020

Conversation

rokm
Copy link
Member

@rokm rokm commented Sep 18, 2020

When loading a system dynamic library via ctypes.CDLL() in a frozen progam, a local directory in sys._MEIPASS with a clashing basename ends up preventing the library from being loaded.

To fix this, use os.path.isdir() in addition to os.path.exists() to decide whether to use frozen or original library name.

Fixes #5178.

When loading a system dynamic library via ctypes.CDLL() in a
frozen progam, a local directory in sys._MEIPASS with a clashing
basename ends up preventing the library from being loaded.

To fix this, use an os.path.isdir() to decide whether to use
frozen or original library name.

Fixes pyinstaller#5178.
@rokm rokm marked this pull request as ready for review September 21, 2020 08:16
@Legorooj Legorooj merged commit bfc8b08 into pyinstaller:develop Sep 22, 2020
@rokm rokm deleted the fix-dir-shadow-syslib branch October 1, 2020 10:11
@xoviat xoviat mentioned this pull request May 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not able to create mac executable if we have used PyautoGUI in python script
2 participants