matplotlib/matplotlib — Issue #633: find_tex_file often results in OSError on Mac OS X 
Author: SirVer
Created: 2011-12-24 07:43:21+00:00
State: open

Hi,

I am using matplotlib's tex text formatting feature on Mac OS X and run into trouble: more often than not the function find_tex_file in dviread.py throws an OSError (interrupted system call) - it seems as pipe.communicate() does *not* wait for the process to terminate as it is stated in the python docs. The fix is very easy: just add pipe.wait() directly before the pipe.communicate() call which *does* wait for the process to terminate and solves this problem for good and should not hurt on any other OS.

Also note that the function _read_nointr that is defined below is never used - it seems like it was once used to work around my problem as it does what I did at first also: just loop and retry till no race condition occures. That is obviously not a good solution though :).