> Daniel.-- When an engineer says that something can't be done, it's a code
phrase that means it's not fun to do.
>
>
Hi!
I used to suffer from the same bug and temporarilly redirected stderr to
/dev/null during the corresponding pyplot call. Now I enjoy clean output again!
here is a patch for
/usr/local/lib/python2.7/dist-packages/matplotlib-1.4.2-py2.7-linux-
x86_64.egg/matplotlib/backends/backend_gtk.py
(path and version of backend_gtk may differ)
---
/usr/local/lib/python2.7/dist-packages/matplotlib-1.4.2-py2.7-linux
x86_64.egg/matplotlib/backends/backend_gtk.py
2014-11-06 17:11:10.634287830 +0100
+++ trick 2014-11-06 17:09:36.802288505 +0100
@@ -250,9 +250,13 @@
def destroy(self):
#gtk.DrawingArea.destroy(self)
self.close_event()
+ # a redirection hack to block the glib warnings! JFM Nov 6 2014
+ temp = sys.stderr
+ sys.stderr = open('/dev/null','w')
gobject.source_remove(self._idle_event_id)
if self._idle_draw_id != 0:
gobject.source_remove(self._idle_draw_id)
+ sys.stderr = temp
def scroll_event(self, widget, event):
if _debug: print('FigureCanvasGTK.%s' % fn_name())
!! some lines had to be broken to be shorter than 80 chars... but you should
get the idea
JF