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

FIxed #8156: UploadedFile.__repr__ now returns a string, a good __repr__ should.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2008-08-27 20:53:02 +00:00
parent 40e5cde1c5
commit c33aeaa082
2 changed files with 11 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ except ImportError:
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import smart_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',
'SimpleUploadedFile')
@@ -32,7 +33,7 @@ class UploadedFile(File):
self.charset = charset
def __repr__(self):
return "<%s: %s (%s)>" % (self.__class__.__name__, self.name, self.content_type)
return "<%s: %s (%s)>" % (self.__class__.__name__, smart_str(self.name), self.content_type)
def _get_name(self):
return self._name