Author cykerway
Recipients cykerway
Date 2018-11-26.10:58:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In short, `fnmatch.fnmatch` doesn't match shell result. To test this, create a dir with 2 files: `` and ``. Then `ls [!b].py` and `ls [^b].py` will both show ``. However, `fnmatch.fnmatch('', '[!b].py')` returns `True` but `fnmatch.fnmatch('', '[^b].py')` returns `False`.

Problem seems to come from an escaped caret:

I don't see why caret and exclamation mark are different from `man bash`:

>   ...If the first character following the [ is a !  or a ^ then any character not enclosed is matched...

Could someone please confirm it's a bug or intended behavior?
Date User Action Args
2018-11-26 10:58:12cykerwaysetrecipients: + cykerway
2018-11-26 10:58:12cykerwaysetmessageid: <>
2018-11-26 10:58:12cykerwaylinkissue35314 messages
2018-11-26 10:58:12cykerwaycreate