Hi!
Thanks for the regtest utility. It will help for saver uploading patches
and produce patches less buggy, at least for me.
But running it against my PDF files, I encountered a small problem. In
the way the scripts starts it subprocesses, stderr becomes buffered for
the subprocesses. And unforunately, when the buffer limit is reached,
the subprocess suspends it work until it can print again on stderr.
That's why the python script runs into a deadlock when the subprocess
produces a lot of error messages. A small rearrange of the commands,
first read the stderr output and then wait that the subprocess ends,
will remove this deadlock.
Best regards,
Thomas
diff --git a/regtest/backends/__init__.py b/regtest/backends/__init__.py
index 157170d..47985fb 100644
--- a/regtest/backends/__init__.py
+++ b/regtest/backends/__init__.py
@@ -173,11 +173,11 @@ class Backend:
return True
def _check_exit_status(self, p, out_path):
- status = p.wait()
-
stderr = p.stderr.read()
self.__create_stderr_file(stderr, out_path)
+ status = p.wait()
+
if not os.WIFEXITED(status):
open(out_path + '.crashed', 'w').close()
return False
@@ -188,11 +188,11 @@ class Backend:
return True
def _check_exit_status2(self, p1, p2, out_path):
+ p1_stderr = p1.stderr.read()
status1 = p1.wait()
+ p2_stderr = p2.stderr.read()
status2 = p2.wait()
- p1_stderr = p1.stderr.read()
- p2_stderr = p2.stderr.read()
if p1_stderr or p2_stderr:
self.__create_stderr_file(p1_stderr + p2_stderr, out_path)
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler