Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #23298 -- Made makemessages actually ignore specified dirs on W…

…indows.

This was detected by two failures in the i18n.test_extraction of our
test suite.

Refs #20422, refs #22336
  • Loading branch information...
commit b4dce7c37ab7666b023ac791d2c46dad6c8aa637 1 parent d441a9d
Ramiro Morales authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 django/core/management/commands/makemessages.py
View
13 django/core/management/commands/makemessages.py
@@ -364,8 +364,17 @@ def is_ignored(path, ignore_patterns):
fnmatch.fnmatchcase(path, pattern))
return any(ignore(pattern) for pattern in ignore_patterns)
- dir_suffix = '%s*' % os.sep
- norm_patterns = [p[:-len(dir_suffix)] if p.endswith(dir_suffix) else p for p in self.ignore_patterns]
+ ignore_patterns = [os.path.normcase(p) for p in self.ignore_patterns]
+ dir_suffixes = {'%s*' % path_sep for path_sep in {'/', os.sep}}
+ norm_patterns = []
+ for p in ignore_patterns:
+ for dir_suffix in dir_suffixes:
+ if p.endswith(dir_suffix):
+ norm_patterns.append(p[:-len(dir_suffix)])
+ break
+ else:
+ norm_patterns.append(p)
+
all_files = []
for dirpath, dirnames, filenames in os.walk(root, topdown=True, followlinks=self.symlinks):
for dirname in dirnames[:]:
Please sign in to comment.
Something went wrong with that request. Please try again.