Code

Ticket #7594: file_upload_in_memory_fix.diff

File file_upload_in_memory_fix.diff, 695 bytes (added by Bastian Kleineidam <calvin@…>, 6 years ago)
Line 
1diff --git a/django/core/files/uploadedfile.py b/django/core/files/uploadedfile.py
2index 51cec17..922a374 100644
3--- a/django/core/files/uploadedfile.py
4+++ b/django/core/files/uploadedfile.py
5@@ -140,7 +135,7 @@ class InMemoryUploadedFile(UploadedFile):
6     A file uploaded into memory (i.e. stream-to-memory).
7     """
8     def __init__(self, file, field_name, file_name, content_type, charset, file_size):
9-        super(InMemoryUploadedFile, self).__init__(file_name, content_type, charset, file_size)
10+        super(InMemoryUploadedFile, self).__init__(file_name, content_type, file_size, charset)
11         self.file = file
12         self.field_name = field_name
13         self.file.seek(0)