Qt4 bug on OSX with close()

Hi all,

I'm wondering if anyone knows what the problem is (traceback at the
end). If I use close() when running with the Qt4Agg backend under
OSX, the figures do not close, and I get a nasty traceback instead.
Perhaps the problem also exists on other OSes (I hope, so it's easier
to fix), but I only have a Qt4 build on OSX (PPC) 10.4.9.

This is with a fairly recent SVN build:

In [21]: matplotlib.__revision__
Out[21]: '$Revision: 3125 $'

Any help on this one would be greatly appreciated (and John: I think
this is the backend we'll be using, so it would be very nice to get
this fixed :slight_smile:

Cheers,

f

In [19]: close('all')

···

---------------------------------------------------------------------------
<type 'exceptions.TypeError'> Traceback (most recent call last)

/Users/fperez/py4science/examples/<ipython console> in <module>()

/usr/local/txpython/local/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/pylab.py
in close(*args)
    728 if arg=='all':
    729 for manager in _pylab_helpers.Gcf.get_all_fig_managers():
--> 730 _pylab_helpers.Gcf.destroy(manager.num)
    731 elif isinstance(arg, int):
    732 _pylab_helpers.Gcf.destroy(arg)

/usr/local/txpython/local/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/_pylab_helpers.py
in destroy(num)
     26 del Gcf.figs[num]
     27 #print len(Gcf.figs.keys()), len(Gcf._activeQue)
---> 28 figManager.destroy()
     29 gc.collect()
     30

/usr/local/txpython/local/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/backends/backend_qt4.py
in destroy(self, *args)
    246 self.window._destroying = True
    247 if DEBUG: print "destroy figure manager"
--> 248 self.window.close(True)
    249
    250 class NavigationToolbar2QT( NavigationToolbar2, QtGui.QWidget ):

<type 'exceptions.TypeError'>: too many arguments to QWidget.close(),
0 at most expected

Hi Fernando,

I'll have a look at this, but I might not be able to get to it until this
weekend. Is that ok for you?

Darren

···

On Friday 30 March 2007 1:37:09 am Fernando Perez wrote:

Hi all,

I'm wondering if anyone knows what the problem is (traceback at the
end). If I use close() when running with the Qt4Agg backend under
OSX, the figures do not close, and I get a nasty traceback instead.
Perhaps the problem also exists on other OSes (I hope, so it's easier
to fix), but I only have a Qt4 build on OSX (PPC) 10.4.9.

This is with a fairly recent SVN build:

In [21]: matplotlib.__revision__
Out[21]: 'Revision: 3125 '

Any help on this one would be greatly appreciated (and John: I think
this is the backend we'll be using, so it would be very nice to get
this fixed :slight_smile:

This is fixed in svn 3137.

Darren

···

On Friday 30 March 2007 06:07:26 am Darren Dale wrote:

On Friday 30 March 2007 1:37:09 am Fernando Perez wrote:
> Hi all,
>
> I'm wondering if anyone knows what the problem is (traceback at the
> end). If I use close() when running with the Qt4Agg backend under
> OSX, the figures do not close, and I get a nasty traceback instead.
> Perhaps the problem also exists on other OSes (I hope, so it's easier
> to fix), but I only have a Qt4 build on OSX (PPC) 10.4.9.
>
> This is with a fairly recent SVN build:
>
> In [21]: matplotlib.__revision__
> Out[21]: 'Revision: 3125 '
>
> Any help on this one would be greatly appreciated (and John: I think
> this is the backend we'll be using, so it would be very nice to get
> this fixed :slight_smile:

Many, many thanks Darren, especially for looking into this so quickly.

I'll finish testing this setup with the rest of our codes and will let
you know if we hit any other Qt-specific bumps.

Cheers,

f

···

On 3/30/07, Darren Dale <dd55@...143...> wrote:

This is fixed in svn 3137.