Felix Patzelt <fe...@neuro.uni-bremen.de> writes:
> Matplotlib-Version: 1.1.0
If that's the released version and not something from git, it does not
have one possibly related fix. Could you try cherry-picking commit
09293bf from github, or applying the following patch.
commit 09293bf96f79f305d96ae4070dc89537efb9fb17
Author: Jouni K. Seppänen <j...@iki.fi>
Date: Tue Dec 27 20:21:34 2011 +0200
Work around subprocess EINTR bug; fixes issue #633
The bug http://bugs.python.org/issue12493 is present in some Python
versions.
The _read_nointr function has been unused since b03a908 (it did
not work on Windows).
diff --git a/CHANGELOG b/CHANGELOG
index 9f5c700..e2a2b9d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+2011-12-27 Work around an EINTR bug in some versions of subprocess. - JKS
+
2011-08-18 Change api of Axes.get_tightbbox and add an optional
keyword parameter *call_axes_locator*. - JJL
diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py
index 85fa70f..8a6dbd2 100644
--- a/lib/matplotlib/dviread.py
+++ b/lib/matplotlib/dviread.py
@@ -835,23 +835,17 @@ def find_tex_file(filename, format=None):
matplotlib.verbose.report('find_tex_file(%s): %s' \
% (filename,cmd), 'debug')
- pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ # stderr is unused, but reading it avoids a subprocess optimization
+ # that breaks EINTR handling in some Python versions:
+ # http://bugs.python.org/issue12493
+ # https://github.com/matplotlib/matplotlib/issues/633
+ pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
result = pipe.communicate()[0].rstrip()
matplotlib.verbose.report('find_tex_file result: %s' % result,
'debug')
return result
-def _read_nointr(pipe, bufsize=-1):
- while True:
- try:
- return pipe.read(bufsize)
- except OSError, e:
- if e.errno == errno.EINTR:
- continue
- else:
- raise
-
-
# With multiple text objects per figure (e.g. tick labels) we may end
# up reading the same tfm and vf files many times, so we implement a
# simple cache. TODO: is this worth making persistent?
--
Jouni K. Seppänen
http://www.iki.fi/jks
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users