diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-05-07 17:55:38 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-05-07 17:55:38 +0000 |
| commit | 09c2559b4193992f6ba29f033052b81c87f4f2f0 (patch) | |
| tree | 11beace9357fb0f7a69cd4c53330a9979329e2a1 | |
| parent | b03e58b936a9541a1fb63e92ac207b51e9551e66 (diff) | |
[1.0.X] Fixed #11030: fixed file uploads on non-utf8 filesystem encoding. Thanks, Honza Kral. Backport of [10693] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10695 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/files/storage.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/files/storage.py b/django/core/files/storage.py index a1b843d5a1..52623a465d 100644 --- a/django/core/files/storage.py +++ b/django/core/files/storage.py @@ -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.text import get_valid_filename from django.utils._os import safe_join @@ -211,7 +211,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)) |
