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 Jim Nasby
Recipients Jim Nasby
Date 2016-11-16.20:12:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479327127.15.0.931047394142.issue28718@psf.upfronthosting.co.za>
In-reply-to
Content
A '*' in fnmatch.translate is converted into '.*', which will greedily match directory separators. This doesn't match shell behavior, which is that * will only match file names:

decibel@decina:[14:07]~$ls ~/tmp/*/1|head
ls: /Users/decibel/tmp/*/1: No such file or directory
decibel@decina:[14:07]~$ls ~/tmp/d*/base/1|head
112

From a posix standpoint, this would easily be fixed by using '[^/]*' instead of '.*'. I'm not sure how to make this work cross-platform though.

It's worth noting that some programs (rsync, git) support **, which would correctly translate to '.*'.
History
Date User Action Args
2016-11-16 20:12:07Jim Nasbysetrecipients: + Jim Nasby
2016-11-16 20:12:07Jim Nasbysetmessageid: <1479327127.15.0.931047394142.issue28718@psf.upfronthosting.co.za>
2016-11-16 20:12:07Jim Nasbylinkissue28718 messages
2016-11-16 20:12:06Jim Nasbycreate