-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
ImageTk int overflow error #1902
Comments
It's not actually a 64 bit address, but it is in the upper 2gb of a 32 bit address. Which is too big to fit into a Py_ssize_t on 32 bit, which is limited to 2^31. The value is actually a PyInt_FromLong, from _tkinter.c:
Which is interpreted as a an int->Py_ssize_t in _imagingtk.c
Given the evidence here, I don't think that it's actually possible to reliably (in all cases, with all corners of 32/64 signed/unsigned silliness) pass a pointer through as an interpreted int. It can be passed as a PyInt, and then it needs to be interpreted as something like:
|
from the debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847812 |
I had a similar issue in one program of mine, and I solve it by changing the ParseTuple as
and it works nicely in both 32bit and 64bit environments. |
I don't think that is valid in a 64 bit environment because a pointer doesn't fit into an unsigned long. |
I am running on a 32bit Fedora-23 virtual machine via virtualbox, version 3.0.0-4
When I try to convert an image to tkimage I get an overflow error
since the tk.interpaddr() returns a 64bit address which cannot be converted to int.
The same code in 64bit Fedora-23 save version works ok.
The text was updated successfully, but these errors were encountered: