bug(?) in wx.URLDataObject in wxPython 2.6.1.0 on OS X? (repost)

I sent the following post to the wxPython-dev group on Nov 4 but go no reply. (http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?12:mss:2438:200511:aplhmpfijdehjhinpmgi)

I thought that I'd try again, this time in the wxpython-users list.

I've been working a wxPython app from Win32 to MacOsX and Linux. The following snippet of code works fine on Win32 wxPython 2.6.0.0 and Linux wxPython 2.6.1.1pre but causes an error on the Mac wxPython 2.6.1.0:

import wx
fileobj = wx.FileDataObject()
urlobj = wx.URLDataObject()
urlobj.Add(fileobj)

The error on the Mac is:

Debug: ../src/common/list.cpp(244): assert "wxAssertFailure" failed: need a key for the object to append
../src/common/list.cpp(244): assert "wxAssertFailure" failed: need a key for the object to append

Now if I modify the program to change urlobj to be wx.DataObjectComposite (from which wx.URLDataObject is dervied), I don't get any errors.

Is this a bug in wxPython or with wxWidgets? Is this the right place to report this problem? If not, please let this wxPython-newbie know the right venue for getting help.

Thanks,

-Raymond Yee

Raymond Yee wrote:

I sent the following post to the wxPython-dev group on Nov 4 but go no reply. (http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?12:mss:2438:200511:aplhmpfijdehjhinpmgi)

I thought that I'd try again, this time in the wxpython-users list.

I've been working a wxPython app from Win32 to MacOsX and Linux. The following snippet of code works fine on Win32 wxPython 2.6.0.0 and Linux wxPython 2.6.1.1pre but causes an error on the Mac wxPython 2.6.1.0:

import wx
fileobj = wx.FileDataObject()
urlobj = wx.URLDataObject()
urlobj.Add(fileobj)

The error on the Mac is:

Debug: ../src/common/list.cpp(244): assert "wxAssertFailure" failed: need a key for the object to append
../src/common/list.cpp(244): assert "wxAssertFailure" failed: need a key for the object to append

Now if I modify the program to change urlobj to be wx.DataObjectComposite (from which wx.URLDataObject is dervied), I don't get any errors.

Is this a bug in wxPython or with wxWidgets? Is this the right place to report this problem? If not, please let this wxPython-newbie know the right venue for getting help.

It's a wxPython bug. The problem is that wx.URLDataObject only derives from wx.DataObjectComposite on Windows. On the other platforms it is just a wx.TextDataObject but wxPython doesn't correctly recognise that. I'll add an item to my ToDo list for this.

ยทยทยท

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