Crash in 2.5.1.2 and 2.5.1.3

I wondered, why my proggi crashes with 2.5 and ran with 2.4.

I tried to isolate step after step and found out that:

···

----

from wxPython.wx import *
wxNamedColour("BLUE")

---

causes the crash.

#WXMSW251H_CORE_VC! 00d31d72() access violation c0000005
(I found with VC, when I start the debug)

(I have German Windows XP)
The error says something like:

Error in Application.
The command in 0x00d31d72 refers to memory 0xc0c0c0c0. the process read
could
not be performed on the memory.
ok .. end, cancel debug.

Can someone duplicate this error?

regards,

Franz Steinhaeusler wrote:

I wondered, why my proggi crashes with 2.5 and ran with 2.4.

I tried to isolate step after step and found out that:

----

from wxPython.wx import *
wxNamedColour("BLUE")

---

causes the crash.

#WXMSW251H_CORE_VC! 00d31d72() access violation c0000005
(I found with VC, when I start the debug)

(I have German Windows XP)
The error says something like:

Error in Application.
The command in 0x00d31d72 refers to memory 0xc0c0c0c0. the process read
could
not be performed on the memory.
ok .. end, cancel debug.

Can someone duplicate this error?

Look at the Migration Guide, in the section titled "Module Initialization". The "BLUE" is converted to a wxColour using the wxColourDatabase, but that is no longer initialiazed until the wx.App is created. If you had tried using one of the preinstantiated colour objects, or directly used the wxColourDatabase, then I can catch it and raise an exception, but I can't catch it in wx.NamedColour.

Python 2.3 (#2, Aug 31 2003, 17:27:29)
[GCC 3.3.1 (Mandrake Linux 9.2 3.3.1-1mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> print wx.BLUE.Get()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/projects/wx2.5/wxPython/wx/core.py", line 9306, in __getattr__
     raise PyUnbornObjectError(self.attrStr) # % self._name )
wx.core.PyUnbornObjectError: The C++ part of this object has not been initialized, attribute access not allowed.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!