From: Nick Coghlan Date: Mon, 29 Jul 2013 07:51:16 +0000 (+1000) Subject: Third attempt to fix #15415 on Windows X-Git-Tag: v3.4.0a1~48^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c06c0aed58db0f223e91607485de8a9fe77c3e7e;p=thirdparty%2FPython%2Fcpython.git Third attempt to fix #15415 on Windows With help from jkloth on IRC, so it will hopefully work this time :) --- diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py index 68e35b3d3bed..43abf9b7e1d2 100644 --- a/Lib/test/test_startfile.py +++ b/Lib/test/test_startfile.py @@ -21,12 +21,14 @@ class TestCase(unittest.TestCase): self.assertRaises(OSError, startfile, "nonexisting.vbs") def test_empty(self): - # startfile is a little odd when it comes to handling absolute - # paths, so we briefly switch to the main test directory - # and use a relative path - with support.change_cwd(support.TEST_HOME): - empty = "empty.vbs" + # We need to make sure the child process starts in a directory + # we're not about to delete. If we're running under -j, that + # means the test harness provided directory isn't a safe option. + # See http://bugs.python.org/issue15526 for more details + with support.change_cwd(path.dirname(sys.executable)): + empty = path.join(path.dirname(__file__), "empty.vbs") startfile(empty) + startfile(empty, "open") def test_main(): support.run_unittest(TestCase)