﻿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
16946	core.files.File assumes name attribute on file-like objects	Paul McMillan	Simon Charette	"The django.core.files.File object is a wrapper to add some django-specific stuff around standard python file-like objects. 

https://code.djangoproject.com/browser/django/trunk/django/core/files/base.py#L10

In the `__init__` and elsewhere, `File` works around file-like objects which may not have a `name` attribute ([http://docs.python.org/library/stdtypes.html#file.name optional for python file objects]). However, down in the `_size()` getter, it [https://code.djangoproject.com/browser/django/trunk/django/core/files/base.py#L39 slips up and makes the assumption that the file-like object has a name attribute]. This means that it produces a confusing attribute error about `name` rather than the desired error about being unable to determine a file's size.

This should be patched to check for self.name before doing the os.path.exists, like line 113.
"	Bug	closed	Core (Other)	1.3	Normal	duplicate		charette.s@… nickname123	Accepted	1	0	1	1	1	0
