Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed loaddata for Django checkouts with non ASCII chars in the name.

  • Loading branch information...
commit c9d07d251fc68fe1a80c2a49e183bbef546238d9 1 parent 6900cb7
@apollo13 apollo13 authored
View
3  django/core/management/commands/loaddata.py
@@ -16,6 +16,7 @@
from django.db.models import get_app_paths
from django.utils.encoding import force_text
from django.utils.functional import cached_property, memoize
+from django.utils._os import upath
from itertools import product
try:
@@ -237,7 +238,7 @@ def fixture_dirs(self):
dirs.append(d)
dirs.extend(list(settings.FIXTURE_DIRS))
dirs.append('')
- dirs = [os.path.abspath(os.path.realpath(d)) for d in dirs]
+ dirs = [upath(os.path.abspath(os.path.realpath(d))) for d in dirs]
return dirs
def parse_name(self, fixture_name):
View
2  django/utils/_os.py
@@ -38,7 +38,7 @@ def upath(path):
"""
Always return a unicode path.
"""
- if not six.PY3:
+ if not six.PY3 and not isinstance(path, six.text_type):
return path.decode(fs_encoding)
return path
Please sign in to comment.
Something went wrong with that request. Please try again.