[python] tkinter a win32ui

Dan Pressl nu.frix na gmail.com
Středa Říjen 16 11:57:56 CEST 2013


Ohledne informace by mohl pomoci tento odkaz:

http://sourceforge.net/p/pywin32/bugs/609/

V podstate se v nem clovek dozvi, ze to je bug. Konkretne je to popsano v
tomto prispevku:

http://sourceforge.net/p/pywin32/bugs/609/#73e1

kde se pise:

I reproduced the behavior on my system and the error occurs due to the
windows hooking mechanism in win32ui. On shutdown a message should be
processed an and since the windows hook in win32ui is still active it is
called. Inside the hook function the GIL should be acquired which waits
forever since Python was already shut down. See WinDbg log
0027fb7c 750a149d 000000c8 00000000 00000000
ntdll!NtWaitForSingleObject+0x15
...
0027fc54 1e108002 00000000 00000000 00000000 python27!PyThreadState_New+0xc
0027fc64 1e2d128d 0027fd0c 0027fd0c 00000000 python27!PyGILState_Ensure+0x22
0027fce8 75586a58 00040000 00000000 0027fd0c
win32ui!Python_check_message+0x3d
0027fd1c 75526e44 00976550 00000000 00000002 USER32!fnHkINLPCWPSTRUCTA+0x66
0027fd58 7710010a 0027fd70 00000000 0027fdcc USER32!__fnDWORD+0x2b
0027fd6c 00976550 00000000 00000002 00000000
ntdll!KiUserCallbackDispatcher+0x2e
0027fddc 75155a20 3d24bba6 00496590 00000002 0x976550
0027fe0c 77129ab1 0027dc34 7efde000 7efdd000 MSCTF!CicFlsCallback+0x98
0027fe28 7713d608 00496580 77413563 771f20c0 ntdll!RtlProcessFlsData+0x57
0027fec0 7713d554 02063b88 02063b84 00000001 ntdll!LdrShutdownProcess+0xbd

The changed behavior was introduced in Rev 3266. If checking the window
before acquiring the Python lock the deadlock does not occur anymore. I
attached a diff which fixes this problem.


2013/10/16 <mol-python na seznam.cz>

> Dobrý den.
>
>
>
> Zajímavé, že třeba v 3.3 (32b) to funguje zatímco v 2.7 (64b) ne.
>
>
>
> Zdraví,
>
> Michal
>
> ---------- Původní zpráva ----------
> Od: mtip <mtip na atlas.cz>
> Datum: 16. 10. 2013
> Předmět: [python] tkinter a win32ui
>
> Zdravim všechny,
>
> Přišel jsem na zajímavej problém.
> Pokud se naimportuje Tk a win32ui, proces nikdy neskončí.
>
> Tady je ukázka:
>
> from Tkinter import Tk
>
> import win32ui
>
> root = Tk()
> root.title('Test')
> root.mainloop()
>
>
>
> Mirek N.
>
>
> _______________________________________________
> Python mailing list
> Python na py.cz
> http://www.py.cz/mailman/listinfo/python
>



-- 
^nu.friX
aka Dan Pressl
Reality is useless & F4Q DMNC!!!
Every syntax creates code. And code is poetry.
------------- další část ---------------
HTML příloha byla odstraněna...
URL: <http://www.py.cz/pipermail/python/attachments/20131016/f7c6813c/attachment.html>


Další informace o konferenci Python