`shell_format` work incorrect on windows.

Issue #30 invalid
pahaz NA created an issue
from sarge import shell_shlex, shell_format
import shlex
import subprocess

cmd = shell_format("python -c {0}", "print('aw')")
print(cmd)

This code produse:

C:\Users\pahaz_000>C:\Python27\python.exe z.py
python -c 'print('\''aw'\'')'

And on windows whis in incorrect:

C:\Users\pahaz_000\PycharmProjects\dokku>python -c 'print('\''aw'\'')'
  File "<string>", line 1
    'print('\''aw'\'')'
                      ^
SyntaxError: unexpected character after line continuation character

On linux correct:

(venv)root@precise64:/vagrant# python -c 'print('\''aw'\'')'
aw

Comments (5)

  1. pahaz NA reporter

    Sorry, I found in docs this "A simple run command which allows a rich subset of Bash-style shell command syntax, but parsed and run by sarge so that you can run on Windows without cygwin."

  2. Vinay Sajip repo owner

    It's not suggested that you can pass a shell_formatted command line directly to cmd.exe - just that you should be able to run it compatibly in sarge, whether or not you're running cygwin.

  3. Log in to comment