python 2.7.12 on Linux behaving differently than on Windows
p.f.moore at gmail.com
Tue Dec 6 05:57:38 EST 2016
On Monday, 5 December 2016 17:14:27 UTC, Skip Montanaro wrote:
> ISTR that the way DOS/Windows operate at the text prompt level was
> modeled on VMS. As you indicated, each command was responsible for its
> own "globbing". I've never programmed in DOS or Windows, and its been
> decades since I programmed in VMS, but I imagine that both
> environments probably provide some standard sort of globbing library.
Technically, the primitive "launch an executable" operation in Windows takes a *command line* to pass to the new process, rather than a list of arguments. The argv convention comes to Windows via C, which is derived from Unix.
So the C runtime historically provided argv splitting to match C semantics, and added globbing as a convenience "because people were used to it from Unix" (even though in Unix it was a shell feature, not a C/application feature). There's also an OS API to do cmdline->argv conversion, for programs that don't want to rely on the C runtime capability.
The result is the same, though - in Windows, applications (or the language runtime) handle globbing, but in Unix the shell does.
More information about the Python-list