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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user