Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #4776 -- Fixed a problem with handling of upload_to attributes.…

… The new

solution still works with non-ASCII filenames. Based on a patch from

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3198b645169714af33af651b7d13c3f26a62c103 1 parent d91fb70
@malcolmt malcolmt authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/fields/
4 django/db/models/fields/
@@ -9,7 +9,7 @@
from django.utils.itercompat import tee
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy, ugettext as _
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_unicode, force_unicode, smart_str
import datetime, os, time
import decimal
@@ -735,7 +735,7 @@ def save_file(self, new_data, new_object, original_object, change, rel, save=Tru
func(new_data[upload_field_name]["filename"], new_data[upload_field_name]["content"], save)
def get_directory_name(self):
- return os.path.normpath(
+ return os.path.normpath(force_unicode(
def get_filename(self, filename):
from django.utils.text import get_valid_filename

0 comments on commit 3198b64

Please sign in to comment.
Something went wrong with that request. Please try again.