wxPython bug

J

Jive

Anyone know what's up with this, and how to fix it?

(I'm running MS Windows 2000 Pro, SP 4)

In wxPython 2.5, run the demo, samples/wxProject/wxProject.py

Create a new project and add a file to it. In the console window you will
probably
see something like this:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Traceback (most recent call last):
File "C:\Python23\Lib\site-packages\wxPython2.5 Docs and
Demos\samples\wxProje
ct\wxProject.py", line 224, in OnFileAdd
self.project_save()
File "C:\Python23\Lib\site-packages\wxPython2.5 Docs and
Demos\samples\wxProje
ct\wxProject.py", line 137, in project_save
(child,iter) = self.tree.GetFirstChild(self.root,iter)
File "C:\PYTHON23\Lib\site-packages\wx-2.5.3-msw-ansi\wx\_controls.py",
line 5
235, in GetFirstChild
return _controls_.TreeCtrl_GetFirstChild(*args, **kwargs)
TypeError: TreeCtrl_GetFirstChild() takes exactly 2 arguments (3 given)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the source code _controls.py, the comments say the file was created by
SWIG.

What to do?
 
J

Johan Lindberg

[...]
What to do?

Open up wxProject.py and fix the problem. The traceback is pretty
clear:
On line 137 in wxProject.py, the method GetFirstChild expects 2
arguments, but was given 3.

Unfortunately the wx documentation is not very clear about the
GetFirstChild method. It
only says:
wxPython note: In wxPython the returned wxTreeItemId and the new
cookie value are both returned as a tuple containing the two values.
It should also mention that it (GetFirstChild) only takes one parameter
(item)

For future reference: keep the wxPython api docs
(http://www.wxpython.org/docs/api/) close.

/Johan Lindberg
 
S

Sion Arrowsmith

Jive said:
In wxPython 2.5, run the demo, samples/wxProject/wxProject.py
[ ... ]
TypeError: TreeCtrl_GetFirstChild() takes exactly 2 arguments (3 given)

GetFirstChild() changed from taking 2 arguments in wxPython 2.4 to
(the more sensible) 1 in wxPython 2.5. Clearly wxProject hasn't
been thoroughly 2.5ified. (Looking at it, it's not using the wx
namespace, so I'd say it's not been 2.5ified at all.)
What to do?

(a) Fix your copy of wxProject.py (someone else has already
pointed this out).

(b) File a bug report (http://sourceforge.net/tracker/?group_id=9863&atid=109863)
with a "wxPython specific" category.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top