I am banned from tracker, so I post the bug here:Normal Windows behavior:>hg status --rev ".^1"M mercurial\commands.py? pysptest.py>hg status --rev .^1abort: unknown revision '.1'!So, ^ is an escape character. See http://www.tomshardware.co.uk/forum/35565-45-when-special-command-lineBut subprocess doesn't escape it, making cross-platform command fail on Windows.---[cut pysptest.py]--import subprocess as sp
# this fails with# abort: unknown revision '.1'!cmd = ['hg', 'status', '--rev', '.^1']# this works#cmd = 'hg status --rev ".^1"'# this works too#cmd = ['hg', 'status', '--rev', '.^^1']try:print sp.check_output(cmd, stderr=sp.STDOUT, shell=True)except Exception as e:print e.output--------------------------------
anatoly t.
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com