Assert in wx_core, wxPython 2.5.3.1 XRCed

If you want to stay with wxPython 2.5.3.1-unicode, you
can put around line 1021 in the
/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/tools/XRCed/xrced.py
file, right after frame.Show(True),
this code:

        try:
            d = wxFileDialog(parent=frame)
        except:
            d = None
        if d: d.Destroy()

and the xrced tool will work.

Note that this error happens when you open a wxFileDialog and others.
So you can get this error in your programs too.
To prevent you can do the same above.
Just put the code above after create the top level frame and give the parent
to wxFileDialog the top level frame.

This is just a workaround that I found to stay in wx-2.5.3.1-unicode

Ricardo

···

John Ralls wrote:

I get the following assert failure when attempting to launch xrced.py.
Mandrake 10.0 using the Mandrake 9.2 rpms. I also get a very similar
assert
when trying to run my own wxPerl app when it's linked against the
wxPython
2.5.3.1 libs. The wxPython demo seems to run fine.

Regards,
John Ralls

The wxPython traceback from xrced:
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/tools/XRCed/xrced.py",
line 1054, in main
    app = App(0, useBestVisual=False)
  File
"/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py",
line 5301, in __init__
    self._BootstrapApp()
  File
"/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py",
line 4980, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File
"/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/tools/XRCed/xrced.py",
line 1023, in OnInit
    frame.res.Load(os.path.join(basePath, 'xrced.xrc'))
  File
"/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/xrc.py",
line 42, in Load
    return _xrc.XmlResource_Load(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "nLen != (size_t)-1" failed
in ../src/common/string.cpp(1060)

This is a known problem, it is basically a failure in converting to
unicode some lines in some system config files that have non-ascii
charactrers in them. It should be fixed in the next build, in the
meantime you should be able to use the ansi build of wxPython.

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