(original) (raw)
On 4/24/06, Jeff Epler <jepler@unpythonic.net> wrote:
FWIW, the Tk_Init manpage says "the Tk interpreter should not already be loaded", and it then goes on to say that if Tk_Init fails to *initialize* the interpreter, an error is returned. So it's unclear to me whether Tk_Init really "loads the interpreter", and whether it unloads after an error occurs (apparently not, I'd say ;)
http://www.tcl.tk/man/tcl8.4/TkLib/Tk_Init.htm
Yes, this C snippet locks up on my systems, just as the python snippet does.
I just read the manpage for Tk_Init(3) (fc4 package tk-8.4.9-3) and it
does not say that Tk_Init() may only be called once. While this doesn't
mean Python shouldn't work around it, I think the behavior should be
considered a bug in Tk, not _tkinter.
FWIW, the Tk_Init manpage says "the Tk interpreter should not already be loaded", and it then goes on to say that if Tk_Init fails to *initialize* the interpreter, an error is returned. So it's unclear to me whether Tk_Init really "loads the interpreter", and whether it unloads after an error occurs (apparently not, I'd say ;)
http://www.tcl.tk/man/tcl8.4/TkLib/Tk_Init.htm
However, on this system, I couldn't recreate the problem you reported
with either the "using _tkinter directly" instructions, or using this
"C" test program:
#include <tcl.h>
#include <
tk.h>
int main(void) {
Tcl_Interp *trp;
unsetenv("DISPLAY");
trp = Tcl_CreateInterp();
printf("%d\n", Tk_Init(trp));
printf("%d\n", Tk_Init(trp));
return 0;
}
Yes, this C snippet locks up on my systems, just as the python snippet does.
--
Thomas Wouters <thomas@python.org
>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!