IOError: [Errno 4] Interrupted system call (Qt4 backend)

When using the Qt4 backend, I’m getting an IOError similar to the one detailed in:

But it’s definitely a separate issue (see Traceback below). This issue also seems specific to Qt (I couldn’t reproduce it on ‘macosx’, ‘tkagg’, or ‘agg’ backends).

I found a number of other people who ran into similar problems with Qt. Their solutions tend to be: catch the error and just try running the process again.

I’m on Qt 4.7.3, OS X 10.6.8, Matplotlib trunk. Any help would be much appreciated.


Script reproducing issue



import matplotlib


import matplotlib.pyplot as plt

for n in xrange(300):

plt.plot([0, 1])


Since it’s a signaling issue, it gets triggered randomly, so the attached

script may or not reproduce the issue.



traceback (most recent call last):

File “”, line 8, in


File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 428, in savefig

return fig.savefig(*args, **kwargs)

File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 1162, in savefig

self.canvas.print_figure(*args, **kwargs)

File “/Users/Tony/python/devel/mpl/lib/matplotlib/backends/”, line

153, in print_figure

FigureCanvasAgg.print_figure(self, *args, **kwargs)

File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 1979, in



File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 1799, in


buf, size = agg.print_to_buffer()

File “/Users/Tony/python/devel/mpl/lib/matplotlib/backends/”, line 45

7, in print_to_buffer


File “/Users/Tony/python/devel/mpl/lib/matplotlib/backends/”, line 40

0, in draw

self.renderer = self.get_renderer()

File “/Users/Tony/python/devel/mpl/lib/matplotlib/backends/”, line 41

1, in get_renderer

self.renderer = RendererAgg(w, h, self.figure.dpi)

File “/Users/Tony/python/devel/mpl/lib/matplotlib/backends/”, line 51

, in init


File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 114, in _


self._text2path = textpath.TextToPath()

File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 37, in _init


self._adobe_standard_encoding = self._get_adobe_standard_encoding()

File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 41, in _get_ad


enc_name = dviread.find_tex_file(‘8a.enc’)

File “/Users/Tony/python/devel/mpl/lib/matplotlib/”, line 837, in find_te


result = pipe.communicate()[0].rstrip()

File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subpro", line 663, in communicate

stdout =

IOError: [Errno 4] Interrupted system call