diff options
authorRelease Manager <>2018-04-13 16:04:31 +0200
committerVolker Braun <>2018-04-13 16:04:31 +0200
commit9bac572eb4a2351c4bbd47aa30fe8b8b57b65051 (patch)
parentTrac #25092: sage --gdb does not start due to SIGFPE (diff)
parentadd a more detailed comment (diff)
Trac #25107: Ignored OSErrors in test output on Cygwin
When running the test suite on Cygwin, whether a test passes or fails the test log is full (for each test module of output like): {{{ sage -t --long src/sage/interfaces/ Exception OSError: (2, 'No such file or directory', '/tmp/tmpwVkVtd') in <bound method _TemporaryFileWrapper.__del__ of <closed file '<fdopen>', mode 'w+b' at 0x6f8032f1e40>> ignored [224 tests, 49.25 s] }}} in particular this of course causes tests of the doctest runner itself to fail, and it's also making all the patchbot runs fail. URL: Reported by: embray Ticket author(s): Erik Bray Reviewer(s): Jeroen Demeyer
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sage/doctest/ b/src/sage/doctest/
index 2fe47d7..48e057f 100644
--- a/src/sage/doctest/
+++ b/src/sage/doctest/
@@ -1991,6 +1991,19 @@ class DocTestWorker(multiprocessing.Process):
# Note: This closes the tempfile in the child process, but in the
# parent process self.outtmpfile will not be closed yet, and can
# still be accessed in save_result_output
+ if hasattr(self.outtmpfile, 'delete'):
+ # On some platforms (notably Cygwin) tempfile.TemporaryFile is
+ # actually replaced by tempfile.NamedTemporaryFile with
+ # delete=True for this file
+ # This means that we end up with two NamedTemporaryFile
+ # instances--one on the parent process and one on the worker
+ # process. Since NamedTemporaryFile automatically unlinks the
+ # file when it is closed, this can lead to an unhandled
+ # exception in the parent process if the child process closes
+ # this file first. See
+ # for more details.
+ self.outtmpfile.delete = False
def start(self):