This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients alex, cvrebert, eric.araujo, ncoghlan, pitrou
Date 2011-10-24.12:42:26
SpamBayes Score 1.3246329e-06
Marked as misclassified No
Message-id <1319460147.4.0.30578803049.issue13238@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2011-10-24 12:42:27ncoghlansetrecipients: + ncoghlan, pitrou, eric.araujo, alex, cvrebert
2011-10-24 12:42:27ncoghlansetmessageid: <1319460147.4.0.30578803049.issue13238@psf.upfronthosting.co.za>
2011-10-24 12:42:26ncoghlanlinkissue13238 messages
2011-10-24 12:42:26ncoghlancreate