Code

Ticket #8156: uploadedfile.diff

File uploadedfile.diff, 560 bytes (added by julianb, 6 years ago)

encode to ascii

Line 
1Index: django/core/files/uploadedfile.py
2===================================================================
3--- django/core/files/uploadedfile.py   (revision 8434)
4+++ django/core/files/uploadedfile.py   (working copy)
5@@ -32,7 +32,7 @@
6         self.charset = charset
7 
8     def __repr__(self):
9-        return "<%s: %s (%s)>" % (self.__class__.__name__, self.name, self.content_type)
10+        return "<%s: %s (%s)>" % (self.__class__.__name__, self.name.encode("ascii", "replace"), self.content_type)
11 
12     def _get_name(self):
13         return self._name