On Windows, program hangs with Pythonw.exe but not with Python.exe

210 views
Skip to first unread message

Patrick Maher

unread,
Sep 15, 2012, 10:56:55 AM9/15/12
to wxpytho...@googlegroups.com
I'm using Python 2.7 and wxWidgets 2.8.11 on 64-bit Windows 7. If I run the attached little program with the extension ".pyw" then, when I try to close the frame, Windows says "pythonw.exe has stopped working". But if I change the extension to ".py", without changing the program at all, then there is no problem.

The feature of the program that causes this problem is that it sets the same attribute for two days in a CalendarCtrl. If the attribute is set for one day only, or the attribute is given different names each time it is set, then the problem vanishes.

Can anyone explain what is going on here?

Patrick
test.pyw

Robin Dunn

unread,
Sep 15, 2012, 1:38:22 PM9/15/12
to wxpytho...@googlegroups.com
Your attribute object is being destroyed twice. As to why you get the
crash in one but not the other I don't know, but it could be something
like different fatal error handlers in the two runtimes, or perhaps just
Python cleaning up after itself in different orders.


--
Robin Dunn
Software Craftsman
http://wxPython.org

Patrick Maher

unread,
Sep 15, 2012, 2:39:00 PM9/15/12
to wxpytho...@googlegroups.com
Thanks Robin. So a CalendarDateAttr instance is destroyed when it is applied to something? This is news to me. How general is this kind of behavior (i.e., what other sorts of attributes is this true of)? It seems not to be true of TextAttr, since I've applied the same TextAttr multiple times in a TextCtrl without any problems.

Patrick

Reply all
Reply to author
Forward
0 new messages