This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author drj
Recipients drj
Date 2014-06-13.13:31:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402666303.8.0.471997942959.issue21748@psf.upfronthosting.co.za>
In-reply-to
Content
```
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.
History
Date User Action Args
2014-06-13 13:31:43drjsetrecipients: + drj
2014-06-13 13:31:43drjsetmessageid: <1402666303.8.0.471997942959.issue21748@psf.upfronthosting.co.za>
2014-06-13 13:31:43drjlinkissue21748 messages
2014-06-13 13:31:43drjcreate