Ticket #2783 (closed enhancement: fixed)
Python utililities should support command-line wildcards
| Reported by: | mwtoews | Owned by: | hobu |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.8.1 |
| Component: | Utilities | Version: | svn-trunk |
| Severity: | minor | Keywords: | python, glob, gdal_merge, gdalident |
| Cc: | antonio |
Description
At present, a command that uses wildcards does not work as expected, for example with gdal_merge.py:
> gdal_merge.py -o test.tif 094a*
ERROR 4: `094a*' does not exist in the file system,
and is not recognised as a supported dataset name.
Traceback (most recent call last):
File "C:\PROGRA~1\FWTOOL~1.1\bin\gdal_merge.py", line 358, in ?
ulx = file_infos[0].ulx
IndexError: list index out of range
The present workaround is to use batch files and additional parameters (e.g., http://n2.nabble.com/gdal_merge-multiple-files-td2032804.html).
There are two solutions that should be used for all Python command line utilities:
- glob module, which was introduced in Python 2.5
- fnmatch module, introduced pre Python 2.2 (not sure when)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

