# HG changeset patch # User osimons # Date 1252313792 0 # Node ID 80d4c32c810344037600d96384fda228d44729c7 # Parent 22bbda64c9f555a4ad7994286e8e23f7f61aba3c 0.6dev: Follow-up to #441 / [745]. Of course, cmd.exe built-ins was the reason for executing through shell on Windows... This fix adds back support for important built-ins by essentially calling `cmd.exe /C command + args`. diff --git a/bitten/build/shtools.py b/bitten/build/shtools.py --- a/bitten/build/shtools.py +++ b/bitten/build/shtools.py @@ -107,6 +107,12 @@ elif file_: args[:0] = [file_] + # Support important Windows CMD.EXE built-ins (and it does its own quoting) + if os.name == 'nt' and executable.upper() in ['COPY', 'DIR', 'ECHO', + 'ERASE', 'DEL', 'MKDIR', 'MD', 'MOVE', 'RMDIR', 'RD', 'TYPE']: + args = ['/C', executable] + [arg.strip('"') for arg in args] + executable = os.environ['COMSPEC'] + if input_: input_file = file(resolve(input_), 'r') else: