Skip to content

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.

javidcf and others added 3 commits January 5, 2023 00:04
Co-authored-by: Ondrej Baranovič <[email protected]>
Co-authored-by: Ondrej Baranovič <[email protected]>
Co-authored-by: Ondrej Baranovič <[email protected]>
@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.

3 participants