﻿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
26495	Storage save method wraps StringIO in File object which is identified as False.	Maxim Novikov	nobody	"https://github.com/django/django/blob/master/django/core/files/storage.py#L50
{{{
#!python
class Storage(object):

    def save(self, name, content, max_length=None):
        ...
        if not hasattr(content, 'chunks'):
            content = File(content)
}}}
Underlying libraries may use following pattern of code:
{{{
#!python
def store(data, name):
     data = data or ''
}}}
But File object without a name resolved into False which can produce bugs.
Possibly better to pass a name to File object. To ensure bool(content) is True
{{{
#!python
    if not hasattr(content, 'chunks'):
        content = File(content, name=name)
}}}"	Uncategorized	new	File uploads/storage	dev	Normal				Unreviewed	0	0	0	0	0	0
