消息 [146345]
Considering this further, I've realised that the idea of implicit quoting for this style of helper function is misguided on another level - the parameters to be interpolated may not even be strings yet, so attempting to quote them would fail:
>>> subprocess.call("exit {}".format(1), shell=True)
1
>>> shlex.quote(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ncoghlan/devel/py3k/Lib/shlex.py", line 285, in quote
if _find_unsafe(s) is None:
TypeError: expected string or buffer
I'll note that none of these problems will be unique to the new convenience API - they're all a general reflection of the impedance mismatch between typical shell interfaces and filenames that can contain spaces. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2011-10-25 08:52:26 | ncoghlan | 修改 | recipients:
+ ncoghlan, pitrou, eric.araujo, alex, cvrebert |
| 2011-10-25 08:52:26 | ncoghlan | 修改 | messageid: <1319532746.52.0.893489260366.issue13238@psf.upfronthosting.co.za> |
| 2011-10-25 08:52:25 | ncoghlan | 链接 | issue13238 messages |
| 2011-10-25 08:52:25 | ncoghlan | 创建 | |
|