﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11857	TemporaryFile class is missing the closed - attribute	andi100	Christopher Adams <christopher.r.adams@…>	"Hi,


the TemporaryFile-class (core/files/temp.py), is missing the 'closed'-attribute. It inherits from FileProxyMixin, but this class also doesn't have a closed-attribute.

If I want to access the 'width' attribute of an ImageFieldFile, I get an ""'TemporaryFile' object has no attribute 'closed'"" - error.

Traceback:
{{{
File ""D:\websites\picality\src\picalityproject\picality\models\image.py"" in save
  98.         print self.image.width
File ""D:\websites\django-trunk\django\core\files\images.py"" in _get_width
  15.         return self._get_image_dimensions()[0]
File ""D:\websites\django-trunk\django\core\files\images.py"" in _get_image_dimensions
  24.             close = self.closed
File ""D:\websites\django-trunk\django\db\models\fields\files.py"" in _get_closed
  126.         return file is None or file.closed
File ""D:\websites\django-trunk\django\core\files\base.py"" in _get_closed
  51.         return not self.file or self.file.closed

Exception Type: AttributeError at /upload/
Exception Value: 'TemporaryFile' object has no attribute 'closed'
}}}

But somehow this error occurs only if I want to upload 2 image files in the same form -> because if I upload only one image, the self.image.file.file is a StringIO object, which has a 'closed' attribute."	Bug	closed	File uploads/storage		Normal	fixed	TemporaryFile closed windows	petar.maric@… jdunck@… pombredanne@… christopher.r.adams@…	Accepted	1	0	0	0	1	0
