summaryrefslogtreecommitdiff
path: root/django/core/management/__init__.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-12-08 11:13:52 +0100
committerClaude Paroz <claude@2xlibre.net>2012-12-08 11:13:52 +0100
commitc91667338a4e774e2819ccf4da852dc7b759bc19 (patch)
tree42a700d237c85ac2b647999d02d3dcd7d8047068 /django/core/management/__init__.py
parent53b879f045f0e55cc8f4bedff67b5a14f3057561 (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/__init__.py')
-rw-r--r--django/core/management/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index bb26c20666..fab5059376 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -9,6 +9,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from django.utils.importlib import import_module
+from django.utils._os import upath
from django.utils import six
# For backwards compatibility: get_version() used to be in this module.
@@ -410,10 +411,10 @@ def setup_environ(settings_mod, original_settings_path=None):
# Add this project to sys.path so that it's importable in the conventional
# way. For example, if this file (manage.py) lives in a directory
# "myproject", this code would add "/path/to/myproject" to sys.path.
- if '__init__.py' in settings_mod.__file__:
- p = os.path.dirname(settings_mod.__file__)
+ if '__init__.py' in upath(settings_mod.__file__):
+ p = os.path.dirname(upath(settings_mod.__file__))
else:
- p = settings_mod.__file__
+ p = upath(settings_mod.__file__)
project_directory, settings_filename = os.path.split(p)
if project_directory == os.curdir or not project_directory:
project_directory = os.getcwd()