Ticket #7128 (closed Bug: fixed)
Filename Normalizer, when locale=None fails to normalize
|Reported by:||dreamcatcher||Owned by:||hannosch|
Here's a very cornerish case that needs fixing.
In plone.i18n.normalizer, if the FileNameNormalizer ends up receiving a 'None' for locale, the filename *is* normalized, but then when trying to preserve the extension the wrong variable gets used.
# Preserve filename extensions base = baseNormalize(text) ext = '' m = FILENAME_REGEX.match(text) if m is not None: base = m.groups() ext = m.groups()
I believe that FILENAME_REGEX.match() should receive 'base' not 'text' there, as 'base' contains the normalized filename, but 'text' will contain the original, non-normalized filename if locale=None.