Message107369
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. |
|
Date |
User |
Action |
Args |
2010-06-09 00:15:38 | eric.smith | set | recipients:
+ eric.smith, csernazs, larry, Christophe Simonis, r.david.murray, brian.curtin, Alexander.Belopolsky |
2010-06-09 00:15:37 | eric.smith | set | messageid: <1276042537.89.0.665237148268.issue7839@psf.upfronthosting.co.za> |
2010-06-09 00:15:36 | eric.smith | link | issue7839 messages |
2010-06-09 00:15:35 | eric.smith | create | |
|