1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Reverted "Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File."

This reverts commit 1b407050dd as it
introduces a regression in the test for refs #26772.
This commit is contained in:
Tim Graham
2016-06-18 11:06:10 -04:00
parent 625b8e9295
commit cd217de610
3 changed files with 0 additions and 18 deletions

View File

@@ -18,10 +18,6 @@ class File(FileProxyMixin):
self.file = file
if name is None:
name = getattr(file, 'name', None)
# Use only the basename from a file's name if it's an absolute path,
# e.g. from NamedTemporaryFile.
if isinstance(name, six.string_types) and os.path.isabs(name):
name = os.path.basename(name)
self.name = name
if hasattr(file, 'mode'):
self.mode = file.mode