Message146299
Unfortunately, I don't think including implicit shlex.quote() calls is going to have the effect I was originally looking for:
>>> subprocess.call("du -hs ../py*", shell=True)
593M ../py3k
577M ../py3k_pristine
479M ../python27
300M ../python31
381M ../python32
288K ../python_swallowed_whole
0
>>> subprocess.call("du -hs {}".format(shlex.quote("../py*")), shell=True)
du: cannot access `../py*': No such file or directory
1
However, tinkering with this did provide some other "feels like using the shell" examples:
>>> subprocess.call("du -hs ~/devel", shell=True)
4.5G /home/ncoghlan/devel
0
>>> subprocess.call(["du","-hs","~/devel"])
du: cannot access `~/devel': No such file or directory
1
(I'm using the existing subprocess calls rather than the proposed API, since I'm playing with this on the current hg tip without making any changes) |
|
Date |
User |
Action |
Args |
2011-10-24 12:42:27 | ncoghlan | set | recipients:
+ ncoghlan, pitrou, eric.araujo, alex, cvrebert |
2011-10-24 12:42:27 | ncoghlan | set | messageid: <1319460147.4.0.30578803049.issue13238@psf.upfronthosting.co.za> |
2011-10-24 12:42:26 | ncoghlan | link | issue13238 messages |
2011-10-24 12:42:26 | ncoghlan | create | |
|