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

This commit is contained in:
Florian Apolloner 2013-06-03 13:18:16 +02:00
parent 6900cb79dc
commit c9d07d251f
2 changed files with 3 additions and 2 deletions

View File

@ -16,6 +16,7 @@ from django.db import (connections, router, transaction, DEFAULT_DB_ALIAS,
from django.db.models import get_app_paths from django.db.models import get_app_paths
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.functional import cached_property, memoize from django.utils.functional import cached_property, memoize
from django.utils._os import upath
from itertools import product from itertools import product
try: try:
@ -237,7 +238,7 @@ class Command(BaseCommand):
dirs.append(d) dirs.append(d)
dirs.extend(list(settings.FIXTURE_DIRS)) dirs.extend(list(settings.FIXTURE_DIRS))
dirs.append('') 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 return dirs
def parse_name(self, fixture_name): def parse_name(self, fixture_name):

View File

@ -38,7 +38,7 @@ def upath(path):
""" """
Always return a unicode 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.decode(fs_encoding)
return path return path