makemessages ignores "ignore patterns"
|Reported by:||nnseva||Owned by:||claudep|
|Component:||Core (Management commands)||Version:||1.5|
|Cc:||bmispelon@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The default ignore pattern set contains '.*','*~', and 'CVS' patterns. As I was expecting, it should mean that any file having file NAME like these patterns, should be ignored.
Really, the makemessages management command ignores only project root files having file names like these.
As a result, the makemessages makes such unexpected things like walking through all .svn directories except root, or trying to analyze binary Mac OS X - specific file descriptors like '._adminoverride.js'
The reason for such inconsistency is a function is_ignored() defined in the makemessages.py.
While the django 1.5 declares this function in a module context, the current trunk defines it in a context of the find_files() function (it is not important, but makes creating ready-to-use patch harder).
Anyway, the only line required to be fixed is:
if fnmatch.fnmatchcase(path, pattern):
which should be replaced by:
if fnmatch.fnmatchcase(os.path.split(path)[-1], pattern):
This simple change makes makemessages command working with ignore patterns as expected.
The applied patch has been created for django version 1.5.1-final:
>>> import django >>> django.VERSION (1, 5, 1, 'final', 0)
Change History (10)
Changed 3 years ago by nnseva
comment:1 Changed 3 years ago by bmispelon
- Cc bmispelon@… added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 3 years ago by claudep
- Owner changed from nobody to claudep
- Status changed from new to assigned
- Triage Stage changed from Accepted to Ready for checkin
comment:3 Changed 3 years ago by Claude Paroz <claude@…>
- Resolution set to fixed
- Status changed from assigned to closed
comment:4 Changed 2 years ago by fdemmer
- Patch needs improvement set
- Resolution fixed deleted
- Status changed from closed to new
- Version changed from 1.5 to 1.6