[Python-Dev] subprocess not escaping "^" on Windows

Barry Scott barry at barrys-emacs.org
Tue Jan 9 15:17:02 EST 2018


My feeling is that the number of uses for calling cmd /c is rather limited on Windows.

Certainly calling out to use the CMD builtin is not to be encouraged I'd say.
Between shutil and the os module you have most of the file handling commands.
Admin tools might want to run special commands, but they are not builtins.

In all the cases where you have a command line exe to run you can avoid
calling into cmd and the associated quoting problems.

I've found that in all my windows python apps I typically end up using CreateProcess
and ShellExecute for the useful stuff. (I use ctypes to call them).

Is it worth changing the quoting at all? I would say not.

Barry



More information about the Python-Dev mailing list