Message107369
| Author |
eric.smith |
| Recipients |
Alexander.Belopolsky, Christophe Simonis, brian.curtin, csernazs, eric.smith, larry, r.david.murray |
| Date |
2010年06月09日.00:15:35 |
| SpamBayes Score |
0.0017397872 |
| Marked as misclassified |
No |
| Message-id |
<1276042537.89.0.665237148268.issue7839@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|