[issue11077] Tkinter is not thread safe

Scott M report at bugs.python.org
Sat Feb 5 15:49:01 CET 2011


Scott M <scott.mayo at comcast.net> added the comment:

If it helps, over the many iterations of this test code, there have been two kinds of issues:

1. pythonw.exe crashes with the Windows variant of a SEGV. No traceback, just a crash. These are rare.

2. Evidence of confusion over which string the code should be looking at, and it's always down in the create function of Tkinter. Variations of this confusion have been Int() complaining that it can't translate "None", strings like ".667748474.7464" not being recognized as parameter names...  all of it sounds like Tkinter has somehow managed to be looking at the wrong string. Even when the only Tkinter call I do outside the mainloop thread is .after(), the crashes would happen when I went to draw a line.

My (trivial) experience in extending Python makes me wonder if some reference count, somewhere, didn’t get mismanaged. The only times I ever got a hard crash out pythonw.exe in my own projects is when I mishandled a count.

As a side note, if Tkinter is intended to be thread safe, the documentation should say so. Clearly, and in the first paragraph. Once I started having problems, I started Googling, and everything I read lead me to conclude that neither Tkinter nor wx were even intended to be thread safe, so I've started to write my own GUI code. This is a project I might have skipped if it has been clear that Tkinter is at least intended to be thread safe.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11077>
_______________________________________


More information about the Python-bugs-list mailing list