[Python-ideas] Draft PEP: Automatic Globbing of Filenames in argparse on Windows

Kef Schecter furrykef at gmail.com
Fri Aug 14 15:47:28 CEST 2015


On Fri, Aug 14, 2015 at 6:47 AM, Chris Angelico <rosuav at gmail.com> wrote:
> On Fri, Aug 14, 2015 at 7:32 PM, Kef Schecter <furrykef at gmail.com> wrote:
>> PEP: XXX
>> Title: Automatic Globbing of Filenames in argparse on Windows
>>
>> For many command-line tools, it is handy to be able to specify
>> wildcards in order to operate on more than one file at a time.  On
>> Unix-like systems, this is handled automatically by the shell.  On
>> Windows, however, the default shell does not have this behavior, nor
>> does Microsoft's PowerShell.
>>
>> Yet Windows users generally expect wildcards to work.  For example,
>> most built-in commands such as ``dir`` and ``type`` accept wildcard
>> arguments, and have since the early days of MS-DOS.
>
> How does this interact with the 'fileinput' module? Can you tie in with that?

The fileinput module likewise does not expand wildcards and will choke
on an argument such as "*.txt", but I think for that module it would
be safe to make wildcard expansion automatic on Windows, since it's
known that all the arguments are filenames.


More information about the Python-ideas mailing list