Skip to content

Commit

Permalink
[1.0.X] Fixed #11030: fixed file uploads on non-utf8 filesystem encod…
Browse files Browse the repository at this point in the history
…ing. 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
  • Loading branch information
jacobian committed May 7, 2009
1 parent b03e58b commit 09c2559
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/core/files/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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
Expand Down Expand Up @@ -211,7 +211,7 @@ def path(self, name):
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))
Expand Down

0 comments on commit 09c2559

Please sign in to comment.