mirror of https://github.com/django/django.git
Fixed #9344 -- In the `TemporaryFile` class used by Windows, proxy to the wrapped file object. Thanks julien and mitsuhiko.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10699 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7caf21aa2e
commit
304785bf26
|
@ -48,12 +48,11 @@ if os.name == 'nt':
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def read(self, *args): return self.file.read(*args)
|
# Proxy to the file object.
|
||||||
def seek(self, offset): return self.file.seek(offset)
|
def __getattr__(self, name):
|
||||||
def write(self, s): return self.file.write(s)
|
return getattr(self.file, name)
|
||||||
def __iter__(self): return iter(self.file)
|
def __iter__(self):
|
||||||
def readlines(self, size=None): return self.file.readlines(size)
|
return iter(self.file)
|
||||||
def xreadlines(self): return self.file.xreadlines()
|
|
||||||
|
|
||||||
NamedTemporaryFile = TemporaryFile
|
NamedTemporaryFile = TemporaryFile
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue