1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #11030: fixed file uploads on non-utf8 filesystem encoding. Thanks, Honza Kral.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2009-05-07 17:53:23 +00:00
parent fb9ac5729d
commit a59095af24
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding import force_unicode
from django.utils.encoding import force_unicode, smart_str
from django.utils.functional import LazyObject
from django.utils.importlib import import_module
from django.utils.text import get_valid_filename
@@ -212,7 +212,7 @@ class FileSystemStorage(Storage):
path = safe_join(self.location, name)
except ValueError:
raise SuspiciousOperation("Attempted access to '%s' denied." % name)
return os.path.normpath(path)
return smart_str(os.path.normpath(path))
def size(self, name):
return os.path.getsize(self.path(name))