Opened 14 years ago

Closed 14 years ago

#213 closed defect (fixed)

Qt4Agg backend broken in matplotlib

Reported by: goyodiaz Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords:
Cc: willfurnass

Description

D:\>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib as mpl
>>> mpl.use('Qt4Agg')
>>> import matplotlib.pyplot as plt
>>> plt.plot([1, 2])
[<matplotlib.lines.Line2D object at 0x0180FB90>]
>>> plt.show()
Traceback (most recent call last):
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_q
t4.py", line 168, in resizeEvent
    self.draw()
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_q
t4agg.py", line 130, in draw
    FigureCanvasAgg.draw(self)
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_a
gg.py", line 313, in draw
    self.renderer = self.get_renderer()
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_a
gg.py", line 319, in get_renderer
    try: self._lastKey, self.renderer
TypeError: 'sip.methoddescriptor' object is not callable
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_q
t4.py", line 69, in show
    figManager.canvas.draw()
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_q
t4agg.py", line 130, in draw
    FigureCanvasAgg.draw(self)
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_a
gg.py", line 313, in draw
    self.renderer = self.get_renderer()
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_a
gg.py", line 319, in get_renderer
    try: self._lastKey, self.renderer
TypeError: 'sip.methoddescriptor' object is not callable
>>> Traceback (most recent call last):
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_q
t4agg.py", line 83, in paintEvent
    FigureCanvasAgg.draw(self)
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_a
gg.py", line 313, in draw
    self.renderer = self.get_renderer()
  File "D:\OSGeo4w\apps\Python25\lib\site-packages\matplotlib\backends\backend_a
gg.py", line 319, in get_renderer
    try: self._lastKey, self.renderer
TypeError: 'sip.methoddescriptor' object is not callable

The offending line is testing for attributes existence. The next line catches AttributeError but now a TypeError is raised. Catching TypeError in line 320 seems to solve this.

Before:

try: self._lastKey, self.renderer
except AttributeError: need_new_renderer = True
else:  need_new_renderer = (self._lastKey != key)

After

try: self._lastKey, self.renderer
except (AttributeError, TypeError): need_new_renderer = True
else:  need_new_renderer = (self._lastKey != key)

Change History (2)

in reply to:  description comment:1 by willfurnass, 14 years ago

Cc: willfurnass added

comment:2 by jef, 14 years ago

Resolution: fixed
Status: newclosed

fixed in matplotlib-0.99.0-2

Note: See TracTickets for help on using tickets.