Eric Smith <e...@trueblade.com> added the comment:

I agree with David. For the issue raised here, at most I would make (list, 
shell=True) and (str, shell=False) raise errors.

There's an issue (that I can't find right now) for creating functions that 
convert from str->list and list->str for cases such as this. shlex is sort of 
str->list, but it has issues on Windows. I've mentioned elsewhere that for 
Windows list->str is not always possible, because there is no standard for the 
corresponding str->list that each program is responsible for.

On Unix-like systems, when the called programs are run they get a pre-parsed 
list (argv). This list is created by the caller, either directly or through a 
shell. When a shell is doing this, at least the behavior is somewhat standard.

On Windows, the called programs get a string, and they're in charge of parsing 
it, if they want to. Many programs use the C library to create argv, but 
exactly how that parsing works changes between runtime vendors and over time 
within a vendor. There's no solution that will work in all cases.

Which is not to suggest that we shouldn't try, just that it will be hard.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7839>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to