Nick Coghlan <[email protected]> added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com