Tim Golden <m...@timgolden.me.uk> added the comment: Erik Sandberg wrote: > Erik Sandberg <sandb...@virtutech.com> added the comment: > > Did you test your code?
Several times, cutting and pasting into the Python interpreter. But I missed the fact that you were running Python 2.5 Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC Type "help", "copyright", "credits" or "license" for m >>> import subprocess >>> open ("t(o.bat", "w").write ("echo we are here\n") >>> subprocess.call (["t(o.bat"]) c:\temp>echo we are here we are here 0 >>> Testing under 2.5 shows the issue you describe However, I doubt very much whether any change would be made to 2.5 at this point anyway: I think it's in security-bug-fix-only mode now. Bizarrely, I can't see any reason why the behaviour should have changed. Might even be the runtime it links to. > (this guess is based on what I read in msdn.com's docs on CreateProcess: > """To run a batch file, you must start the command interpreter; set > lpApplicationName to cmd.exe and set lpCommandLine to the following > arguments: /c plus the name of the batch file.""") In fact, the shell=True code on Windows basically does: %COMSPEC% /c args... for you behind the scenes. But, as my example above shows, you don't seem to need to do that in any case. TJG ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5484> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com