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

_win32sysloader now uses the same LoadLibrary flags as Python itself … #1794

Merged
merged 1 commit into from
Dec 19, 2021

Conversation

mhammond
Copy link
Owner

…(fixes #1787)

@davidkhess and @tshemeng, it would be great if you could try the artifacts from this PR and see if it addresses your problems.

@mhammond
Copy link
Owner Author

oops - so something is going wrong on CI that I can't reproduce locally - I'll get back to this later.

@mhammond mhammond force-pushed the sys-loader-load-lib branch 3 times, most recently from f6e0cc8 to aa8f482 Compare November 11, 2021 05:26
@mhammond
Copy link
Owner Author

So I fixed CI but I'm not quite sure how it worked in the first place: on CI, we run setup.py install --user, so everything gets installed into %APPDATA% - it's not clear to me how the LoadLibrary() finds it there but LoadLibraryEx() with those flags does not.

So I still need to better understand this, but in the meantime I'd love you hear of experiences using the artifacts.

@mhammond
Copy link
Owner Author

(eg, if you go to the test run at https://github.com/mhammond/pywin32/actions/runs/1447472934, you can find an "artifacts" link which will download a .zip with all the .whl files)

@tshemeng
Copy link

@mhammond much thanks, I tested pywin32-302.1-cp38-cp38-win_amd64.whl, it works for me 💯

@tshemeng
Copy link

@mhammond will this be pushed to pypi soon?

@davidkhess
Copy link

@mhammond sorry for the delay - I tested it and it appears to solve my issue. A conflicting DLL in my PATH is no longer being found and loaded.

Thank you!

@mhammond mhammond force-pushed the sys-loader-load-lib branch from aa8f482 to 18f7cc9 Compare December 19, 2021 07:35
@mhammond mhammond merged commit 0a1d405 into main Dec 19, 2021
@mhammond mhammond deleted the sys-loader-load-lib branch December 19, 2021 07:58
Comment on lines +11 to +12
* Tweaks to how DLLs are loaded and our installation found, which should
improve virtualenv support and version mismatch issues (#1787, #1794)
Copy link

@jiasli jiasli Dec 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR as it prevents loading DLLs from the current directory which is considered insecure.

Besides "improve virtualenv support and version mismatch issues", using LOAD_LIBRARY_SEARCH_DEFAULT_DIRS and LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR also causes other changes regarding how DLLs are loaded, including "DLLs in the current directory are no longer loaded". It will be better if the change log can explain how "tweaks" are made. 😉

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.

Resolving conflicts between multiple installations of pywin32 w/ Python 3.8
4 participants