Index: Lib/test/test_subprocess.py =================================================================== --- Lib/test/test_subprocess.py (Revision 43076) +++ Lib/test/test_subprocess.py (Arbeitskopie) @@ -29,10 +29,16 @@ class ProcessTestCase(unittest.TestCase): def mkstemp(self): """wrapper for mkstemp, calling mktemp if mkstemp is not available""" + # The temporary file needs execution permission which might + # not be available on the canonical tempdir. Thus use the + # parent directory of sys.executable which should also be + # writable since it was used to build the executable in the + # first place. + tdir = os.path.dirname(sys.executable) if hasattr(tempfile, "mkstemp"): - return tempfile.mkstemp() + return tempfile.mkstemp(dir=tdir) else: - fname = tempfile.mktemp() + fname = tempfile.mktemp(dir=tdir) return os.open(fname, os.O_RDWR|os.O_CREAT), fname #