diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-12-08 11:13:52 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-12-08 11:13:52 +0100 |
| commit | c91667338a4e774e2819ccf4da852dc7b759bc19 (patch) | |
| tree | 42a700d237c85ac2b647999d02d3dcd7d8047068 /django/core/management/commands/compilemessages.py | |
| parent | 53b879f045f0e55cc8f4bedff67b5a14f3057561 (diff) | |
Fixed #19357 -- Allow non-ASCII chars in filesystem paths
Thanks kujiu for the report and Aymeric Augustin for the review.
Diffstat (limited to 'django/core/management/commands/compilemessages.py')
| -rw-r--r-- | django/core/management/commands/compilemessages.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py index b7392b9173..e1d8a33332 100644 --- a/django/core/management/commands/compilemessages.py +++ b/django/core/management/commands/compilemessages.py @@ -5,6 +5,7 @@ import os import sys from optparse import make_option from django.core.management.base import BaseCommand, CommandError +from django.utils._os import npath def has_bom(fn): with open(fn, 'rb') as f: @@ -41,8 +42,8 @@ def compile_messages(stderr, locale=None): # command, so that we can take advantage of shell quoting, to # quote any malicious characters/escaping. # See http://cyberelk.net/tim/articles/cmdline/ar01s02.html - os.environ['djangocompilemo'] = pf + '.mo' - os.environ['djangocompilepo'] = pf + '.po' + os.environ['djangocompilemo'] = npath(pf + '.mo') + os.environ['djangocompilepo'] = npath(pf + '.po') if sys.platform == 'win32': # Different shell-variable syntax cmd = 'msgfmt --check-format -o "%djangocompilemo%" "%djangocompilepo%"' else: |
