wxpython error after updating system

Hi

I decided to upgrade my Gentoo system a couple days ago. For the past few years, in my experience, this has been an exercise in destruction, but this time it went pretty well. However, my wxpython doesn't seem to work correctly now.

I have installed:

gcc-4.1.1 (upgraded from 3.something)
glibc-2.5
wxGTK-2.6.3.3
wxpython-2.6.3.3
python-2.5
wxpython-docs-2.6.0.0

Running /usr/share/doc/wxpython-docs-2.6.0.0-r1/demo $ ./demo.py I get the splash screen, then:

···

--------------------------------------------------------------------

(python:6332): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(python:6332): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(python:6332): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed
Traceback (most recent call last):
   File "/usr/share/doc/wxpython-docs-2.6.0.0-r1/demo/Main.py", line 1684, in OnClose
     frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
   File "/usr/share/doc/wxpython-docs-2.6.0.0-r1/demo/Main.py", line 1308, in __init__
     self.LoadDemo(self.overviewText)
   File "/usr/share/doc/wxpython-docs-2.6.0.0-r1/demo/Main.py", line 1375, in LoadDemo
     self.LoadDemoSource()
   File "/usr/share/doc/wxpython-docs-2.6.0.0-r1/demo/Main.py", line 1393, in LoadDemoSource
     self.codePage = DemoCodePanel(self.nb, self)
   File "/usr/share/doc/wxpython-docs-2.6.0.0-r1/demo/Main.py", line 570, in __init__
     wx.RIGHT | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 11711, in Add
     return _core_.Sizer_Add(*args, **kwargs)
TypeError: wx.Window, wx.Sizer, wx.Size, or (w,h) expected for item

----------------------------------------------------------------------

Running xrced gives me a similar response:

----------------------------------------------------

Traceback (most recent call last):
   File "./xrced", line 3, in <module>
     import xrced
   File "/usr/lib/python2.5/site-packages/xrced.py", line 4, in <module>
     main()
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/tools/XRCed/xrced.py", line 1268, in main
     app = App(0, useBestVisual=False)
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7700, in __init__
     self._BootstrapApp()
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7352, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/tools/XRCed/xrced.py", line 1236, in OnInit
     frame = Frame(pos, size)
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/tools/XRCed/xrced.py", line 263, in __init__
     sizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
   File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 11711, in Add
     return _core_.Sizer_Add(*args, **kwargs)
TypeError: wx.Window, wx.Sizer, wx.Size, or (w,h) expected for item

-------------------------------------------------------------------

The programs I have been working on generate similar errors.

It is that last line that has me stumped. I can run a simple program such as:

import wx
app = wx.PySimpleApp()
f = wx.Frame(None, -1, 'Test Frame')
f.Show()
app.MainLoop()

Just fine. Aside from upgrading to gcc4.x, I also "unicode" enabled the complete system build, including python and wxpython.

After uninstalling, reinstalling, installing ansi, and trying about everything else I could think of, nothing seems to have really changed. (I'm back to wx-2.6-gtk2-unicode).

Still thinking I've done something wrong, I downloaded wxPython-src-2.8.0.1 and installed it by hand, using the directions on the website for a stand alone development install in /opt. And that one works fine!

I'm stumped. I suspect this is probably a Gentoo problem, but maybe someone out there has seen this and can give me some direction on what to try next? I've not been able to spot anything with Google or on the Gentoo boards.

Thanks for any insight ...

Peter

Peter van Loben Sels wrote:

Hi

I decided to upgrade my Gentoo system a couple days ago. For the past few years, in my experience, this has been an exercise in destruction, but this time it went pretty well. However, my wxpython doesn't seem to work correctly now.

line 263, in __init__
    sizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
  File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 11711, in Add
    return _core_.Sizer_Add(*args, **kwargs)
TypeError: wx.Window, wx.Sizer, wx.Size, or (w,h) expected for item

-------------------------------------------------------------------

The programs I have been working on generate similar errors.

It is that last line that has me stumped.

Is it possible that the previous 2.6 version was not cleanly uninstalled? This should not happen if the item passed to Add is derived from wxWindow (like wxStaticLine is) but it seems to be getting confused on the typeinfo, which can happen if different versions mix.

···

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

Robin Dunn <robin <at> alldunn.com> writes:

Peter van Loben Sels wrote:
> Hi
>
> I decided to upgrade my Gentoo system a couple days ago. For the past
> few years, in my experience, this has been an exercise in destruction,
> but this time it went pretty well. However, my wxpython doesn't seem to
> work correctly now.
>

> line 263, in __init__
> sizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
> File
> "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line
> 11711, in Add
> return _core_.Sizer_Add(*args, **kwargs)
> TypeError: wx.Window, wx.Sizer, wx.Size, or (w,h) expected for item
>
> -------------------------------------------------------------------
>
> The programs I have been working on generate similar errors.
>
> It is that last line that has me stumped.

Is it possible that the previous 2.6 version was not cleanly
uninstalled? This should not happen if the item passed to Add is
derived from wxWindow (like wxStaticLine is) but it seems to be getting
confused on the typeinfo, which can happen if different versions mix.

Thank you, Robin. I suspect that is the problem. After I posted, I manually
installed a copy of 2.6.3.3 using the tarfile from the Gentoo upload (I couldn't
find that version on the wxpython site) into /opt as a stand alone. It worked
just fine with demo.py.

For what it is worth, in case someone else runs into this problem, I have three
Gentoo machines, all upgraded within about the past month in about the same way.
I checked another machine that had wxpython-2.6 installed before the upgrade and
it has the same behavior now. Both machines worked fine with 2.6 wxpython before
the upgrade. The third machine has never had wxpython on it, so I installed it
(2.6) this morning ... and it works fine.

This morning, I also (again!) uninstalled wxpython and wxGTK on my development
machine where I first found this problem, then went through the whole filesystem
deleting anything left that had wx* or wxGTK* that I thought had anything to do
with the installation, including all the Gentoo Portage files and metadata
files, etc. I then did a --sync with Gentoo, and reinstalled wxpython and
wxpython-docs. No joy ... demo.py crashes with the same error. I'm out of ideas.

I am not very familiar with setup.py -install except as a user. Since I have two
working development versions of wxpython compiled in /opt (2.8 and 2.6), I am
wondering if I can use setup.py to install each of them into
/usr/lib/python/site-packages and then have the ability to use them normally and
select between the two ... and not conflict with each other? Would I need to do
anything else? This might be my best bet in order to get moving again (I'd
uninstall the Gentoo wxpython and wxGTK).

Any help appreciated! I intend to submit a bug report to Gentoo, although I'm a
little at a loss as how to describe this.

Peter wrote:

I am not very familiar with setup.py -install except as a user. Since I have two
working development versions of wxpython compiled in /opt (2.8 and 2.6), I am
wondering if I can use setup.py to install each of them into
/usr/lib/python/site-packages and then have the ability to use them normally and
select between the two ... and not conflict with each other?

Yes. See http://wxpython.org/INSTALL.html

···

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

Robin Dunn <robin <at> alldunn.com> writes:

Peter wrote:
> I am not very familiar with setup.py -install except as a user. Since I have

> two

> working development versions of wxpython compiled in /opt (2.8 and 2.6), I am
> wondering if I can use setup.py to install each of them into
> /usr/lib/python/site-packages and then have the ability to use them normally
> >and
> select between the two ... and not conflict with each other?

Yes. See http://wxpython.org/INSTALL.html

Thank you! I should have caught that. The frustration level is getting pretty
high here.

Peter