Serhiy Storchaka added the comment: It is easy to make fnmatch caching thread safe without locks. Here is a patch.
The problem with fnmatch is that the caching is implicit and a user don't know that any lock are needed. So either the need of the lock should be explicitly documented, or fnmatch should be made thread safe. The second option looks more preferable to me. In 3.x fnmatch is thread safe because thread safe lru_cache is used. ---------- keywords: +patch nosy: +serhiy.storchaka stage: -> patch review Added file: http://bugs.python.org/file37643/fnmatch_threadsafe.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23191> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com