Ticket #10047: patch.diff
File patch.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/core/files/temp.py
28 28 self.file = os.fdopen(fd, mode, bufsize) 29 29 self.close_called = False 30 30 31 def __getattr__(self, name): 32 file = self.__dict__['file'] 33 a = getattr(file, name) 34 if type(a) != type(0): 35 setattr(self, name, a) 36 return a 37 31 38 # Because close can be called during shutdown 32 39 # we need to cache os.unlink and access it 33 40 # as self.unlink only … … 48 55 def __del__(self): 49 56 self.close() 50 57 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() 58 def __iter__(self): 59 return iter(self.file) 57 60 58 61 NamedTemporaryFile = TemporaryFile 59 62 else: