Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
And last but not least, Popen behavior on Windows makes it difficult to write OS-independent Python code which calls external commands that are not binary by default: 2 examples: 1. I wrote a coffeetools package which wraps the CoffeeScript compiler in a Python API. The 'coffee' command is a

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
Nice to see that my topic gains that interest :) And I see that I should have gone more into detail about what I'm actually trying to point out. Chris Angelico wrote: Hmm... hm... Ha! Found the difference. I had an explicit shebang on my script; yours just starts out with shell commands. That

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
Marko Rauhamaa wrote: Anyway, Python has os.system() that does the quick and dirty thing you might be looking for. Always invokes shell == overhead for .exe files -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-07 Thread Stefan Zimmermann
This discussion is getting really interesting and far beyond the actual topic :) I want to add some additional thoughts on Popen: Marko Rauhamaa wrote: Stefan Zimmermann: And last but not least, Popen behavior on Windows makes it difficult to write OS-independent Python code which calls

PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API

2015-05-06 Thread Stefan Zimmermann
Hi. I don't like that subprocess.Popen(['command']) only works on Windows if there is a command.exe in %PATH%. As a Windows user you would normally expect that also command.bat and command.cmd can be run that way. There are simple workarounds like Popen(..., shell=True) but that is a heavy