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

Support arbitrary number of loaded modules on Windows #6761

Merged
merged 9 commits into from Jan 7, 2023

Conversation

javidcf
Copy link
Contributor

@javidcf javidcf commented Nov 25, 2022

Changed the TKinter module loading function for Windows to support the rare (but possible) case of having more than 1024 modules loaded. This is an adaptation of the same fix that was added to Matplotlib in PR #22445 to solve their issue #22378. The same issue happens with Pillow under similar circumstances (error RuntimeError: Could not find Tcl routines with PIL.ImageTk module is loaded).

Changed the TKinter module loading function for Windows to support the rare (but possible) case of having more than 1024 modules loaded. This is an adaptation of the same fix that was added to Matplotlib in [PR #22445](matplotlib/matplotlib#22445).
@radarhere
Copy link
Member

This is currently failing on Cygwin - https://github.com/python-pillow/Pillow/actions/runs/3549349093/jobs/5964443870#step:10:82

src/Tk/tkImaging.c: In function 'load_tkinter_funcs':
src/Tk/tkImaging.c:332:9: error: implicit declaration of function 'PyErr_SetFromWindowsErr' [-Werror=implicit-function-declaration]

@javidcf
Copy link
Contributor Author

javidcf commented Nov 25, 2022

Huh, seems they also had that over there at Matplotlib. Added simple fix.

Use break instead of goto
@radarhere
Copy link
Member

@nulano would you like to review this?

Copy link
Contributor

@nulano nulano left a comment

Choose a reason for hiding this comment

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

The EnumProcessModules changes look good, but the error handling changes seem incorrect.

src/Tk/tkImaging.c Outdated Show resolved Hide resolved
src/Tk/tkImaging.c Outdated Show resolved Hide resolved
src/Tk/tkImaging.c Outdated Show resolved Hide resolved
javidcf and others added 3 commits January 5, 2023 00:04
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
@radarhere
Copy link
Member

Thanks

@radarhere radarhere merged commit a22f6dd into python-pillow:main Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants