[New-bugs-announce] [issue7846] Fnmatch cache is never cleared during usage
report at bugs.python.org
Wed Feb 3 16:02:16 CET 2010
New submission from Andrew Clegg <ancl at pml.ac.uk>:
The fnmatch module has a cache of translation between glob patterns and compiled regular expressions. However this cache is never emptied; only added to. I am writing a python program which as part of its execution checks millions of unique globs - this causes the fnmatch cache to grow enormous.
Attached is a patch to limit the size of the fnmatch cache to 100 (chosen to be the same size as the re module).
components: Library (Lib)
title: Fnmatch cache is never cleared during usage
versions: Python 2.5
Added file: http://bugs.python.org/file16116/fnmatch.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce