Ticket #8156: uploadfile_repr.diff

File uploadfile_repr.diff, 645 bytes (added by marco, 16 years ago)
  • django/core/files/uploadedfile.py

     
    3232        self.charset = charset
    3333
    3434    def __repr__(self):
    35         return "<%s: %s (%s)>" % (self.__class__.__name__, self.name, self.content_type)
     35        if type(self.name) is unicode:
     36            name = repr(self.name)
     37        else:
     38            name = self.name
     39        return "<%s: %s (%s)>" % (self.__class__.__name__, name, self.content_type)
    3640
    3741    def _get_name(self):
    3842        return self._name
Back to Top