Issue3638
Created on 2008-08-21 22:00 by haypo, last changed 2008-09-13 14:22 by gpolo.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
tkinter_remove_mainloop.patch
|
haypo,
2008-08-21 22:00
|
Remove _tkinter.mainloop() method, but keep _tkinter.Tkapp().mainloop() |
|
|
| msg71691 (view) |
Author: STINNER Victor (haypo) |
Date: 2008-08-21 22:00 |
|
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.
|
| msg73188 (view) |
Author: Guilherme Polo (gpolo) |
Date: 2008-09-13 14:19 |
|
Looks fine to me.
But I can't see the reason to keep this as a module function in python
2.6 so I would remove it there too.
|
|
| Date |
User |
Action |
Args |
| 2008-09-13 14:22:24 | gpolo | set | title: tkinter.mainloop() is meanling less and crash: remove it -> tkinter.mainloop() is meaningless and crash: remove it |
| 2008-09-13 14:19:58 | gpolo | set | nosy:
+ gpolo messages:
+ msg73188 |
| 2008-08-26 00:52:57 | ajaksu2 | set | nosy:
+ ajaksu2 |
| 2008-08-21 22:00:13 | haypo | create | |
|