Message220441
```
for f in glob.glob('input/*/*.dat'): print f
```
outputs:
```
input/ghcnm.v3.2.2.20140611/ghcnm.tavg.v3.2.2.20140611.qca.dat
input/ghcnm.v3.2.2.20140506/ghcnm.tavg.v3.2.2.20140506.qca.dat
```
Note that these are not in the right order. Compare with shell which always sorts its globs:
```
drj$ printf '%s\n' input/*/*.dat
input/ghcnm.v3.2.2.20140506/ghcnm.tavg.v3.2.2.20140506.qca.dat
input/ghcnm.v3.2.2.20140611/ghcnm.tavg.v3.2.2.20140611.qca.dat
```
I think the shell behaviour is better and we should be allowed to rely on glob.glob sorting its result.
Note from the documentation: "The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell". The Unix shell has always sorted its globs. |
|
Date |
User |
Action |
Args |
2014-06-13 13:31:43 | drj | set | recipients:
+ drj |
2014-06-13 13:31:43 | drj | set | messageid: <1402666303.8.0.471997942959.issue21748@psf.upfronthosting.co.za> |
2014-06-13 13:31:43 | drj | link | issue21748 messages |
2014-06-13 13:31:43 | drj | create | |
|