Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[py3] Fed strftime with unicode on Python 3

  • Loading branch information...
commit 9cb80356fc4cff7b8ecda91877755d6e361667c4 1 parent c35501a
@claudep claudep authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/fields/files.py
View
4 django/db/models/fields/files.py
@@ -8,7 +8,7 @@
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
-from django.utils.encoding import force_text, smart_bytes
+from django.utils.encoding import force_text, smart_str
from django.utils import six
from django.utils.translation import ugettext_lazy as _
@@ -280,7 +280,7 @@ def contribute_to_class(self, cls, name):
setattr(cls, self.name, self.descriptor_class(self))
def get_directory_name(self):
- return os.path.normpath(force_text(datetime.datetime.now().strftime(smart_bytes(self.upload_to))))
+ return os.path.normpath(force_text(datetime.datetime.now().strftime(smart_str(self.upload_to))))
def get_filename(self, filename):
return os.path.normpath(self.storage.get_valid_name(os.path.basename(filename)))
Please sign in to comment.
Something went wrong with that request. Please try again.