[New-bugs-announce] [issue7846] Fnmatch cache is never cleared during usage

Andrew Clegg 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)
files: fnmatch.patch
keywords: patch
messages: 98786
nosy: andrewclegg
severity: normal
status: open
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>
<http://bugs.python.org/issue7846>
_______________________________________


More information about the New-bugs-announce mailing list