# HG changeset patch # User Christian Wirth # Date 1422011292 -3600 # Node ID 9aa1cff041eb4afe9d23f59567712e255902827c # Parent 8f2fb6bec986c7989d8fb5c3539806c6a32606fa fix in mx.py, MX_SUBPROCESS_COMMAND_FILE opened twice, fails on Windows diff -r 8f2fb6bec986 -r 9aa1cff041eb mxtool/mx.py --- a/mxtool/mx.py Fri Jan 23 10:54:21 2015 +0100 +++ b/mxtool/mx.py Fri Jan 23 12:08:12 2015 +0100 @@ -1881,8 +1881,8 @@ # variable. However, since environment variables share the same resource # space as the command line itself (on Unix at least), this would cause the # limit to be exceeded too easily. - _, subprocessCommandFile = tempfile.mkstemp(suffix='', prefix='mx_subprocess_command.') - with open(subprocessCommandFile, 'w') as fp: + with tempfile.NamedTemporaryFile(suffix='', prefix='mx_subprocess_command.', mode='w', delete=False) as fp: + subprocessCommandFile = fp.name for arg in args: # TODO: handle newlines in args once there's a use case assert '\n' not in arg