Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X]: Fixed #9344 -- In the `TemporaryFile` class used by Windows,…

… proxy to the wrapped file object. Thanks julien and mitsuhiko.

Backport of r10699 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b9893f991aa87062dc483cec242356804b632bb 1 parent 899d484
Gary Wilson Jr. authored May 08, 2009

Showing 1 changed file with 5 additions and 6 deletions. Show diff stats Hide diff stats

  1. 11  django/core/files/temp.py
11  django/core/files/temp.py
@@ -48,12 +48,11 @@ def close(self):
48 48
         def __del__(self):
49 49
             self.close()
50 50
 
51  
-        def read(self, *args):          return self.file.read(*args)
52  
-        def seek(self, offset):         return self.file.seek(offset)
53  
-        def write(self, s):             return self.file.write(s)
54  
-        def __iter__(self):             return iter(self.file)
55  
-        def readlines(self, size=None): return self.file.readlines(size)
56  
-        def xreadlines(self):           return self.file.xreadlines()
  51
+        # Proxy to the file object.
  52
+        def __getattr__(self, name):
  53
+            return getattr(self.file, name)
  54
+        def __iter__(self):
  55
+            return iter(self.file)
57 56
 
58 57
     NamedTemporaryFile = TemporaryFile
59 58
 else:

0 notes on commit 1b9893f

Please sign in to comment.
Something went wrong with that request. Please try again.