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

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 (536 Bytes)

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.

···

On 9/15/12 7:56 AM, Patrick Maher wrote:

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?

--
Robin Dunn
Software Craftsman

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