Ticket #7128 (closed Bug: fixed)

Opened 9 years ago

Last modified 9 years ago

Filename Normalizer, when locale=None fails to normalize

Reported by: dreamcatcher Owned by: hannosch
Priority: blocker Milestone: 3.0.2
Component: Internationalization Version:
Keywords: Cc:


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()[0]
            ext  = m.groups()[1]

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.

Change History

comment:1 Changed 9 years ago by dreamcatcher

  • Status changed from new to closed
  • Priority changed from major to blocker
  • Resolution set to fixed

Fixed in r17239.

comment:2 Changed 9 years ago by hannosch

  • Milestone changed from 3.0.1 to 3.0.2
Note: See TracTickets for help on using tickets.