New submission from STINNER Victor <[EMAIL PROTECTED]>: mainloop() is a method of a Tkapp object, but it's also a method of _tkinter module. In TkApp_MainLoop, self is seen as a TkappObject whereas it can be a module object! So instruction like "self->dispatch=1" will replace a random byte in the module object (eg. ob_type attribute). Example to crash: import gc import _tkinter _tkinter.mainloop() gc.collect()
It always crashs in my Python 3.0, but not in Python 2.6. Solution: just remove _tkinter.mainloop() => it should have no side effect since users use tkinter (without the "_") which only uses Tkapp.mainloop() (the right way to use Tkapp_MainLoop() function). Solution "implemented" in the patch. ---------- components: Library (Lib) files: tkinter_remove_mainloop.patch keywords: patch messages: 71691 nosy: haypo severity: normal status: open title: tkinter.mainloop() is meanling less and crash: remove it type: crash versions: Python 2.6, Python 3.0 Added file: http://bugs.python.org/file11200/tkinter_remove_mainloop.patch _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3638> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com