Code

Ticket #7658: tempfile.2.diff

File tempfile.2.diff, 1.0 KB (added by axiak, 6 years ago)

Updated tempfile diff to fix AttributeError problem.

Line 
1Index: django/core/files/uploadedfile.py
2===================================================================
3--- django/core/files/uploadedfile.py   (revision 7869)
4+++ django/core/files/uploadedfile.py   (working copy)
5@@ -3,7 +3,6 @@
6 """
7 
8 import os
9-import tempfile
10 import warnings
11 try:
12     from cStringIO import StringIO
13@@ -12,6 +11,8 @@
14 
15 from django.conf import settings
16 
17+from django.core.files import temp as tempfile
18+
19 __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile', 'SimpleUploadedFile')
20 
21 # Because we fooled around with it a bunch, UploadedFile has a bunch
22Index: tests/regressiontests/file_uploads/tests.py
23===================================================================
24--- tests/regressiontests/file_uploads/tests.py (revision 7869)
25+++ tests/regressiontests/file_uploads/tests.py (working copy)
26@@ -1,6 +1,6 @@
27 import os
28 import sha
29-import tempfile
30+from django.core.files import temp as tempfile
31 from django.test import TestCase, client
32 from django.utils import simplejson
33