--
Ticket URL: <https://code.djangoproject.com/ticket/18899>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:1>
Comment (by claudep):
In #15644, we added support for file-like objects to the File wrapper. Do
you think it is still too much to call `storage.save(target, File(<file-
like-object>))`?
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:2>
Comment (by vzima):
Replying to [comment:2 claudep]:
> In #15644, we added support for file-like objects to the File wrapper.
Do you think it is still too much to call `storage.save(target, File
(<file-like-object>))`?
Yes. It is seems fairly excessive - you make `File` object from `file`
object - only to provide `chunks()` method. Also this is not a solution
for other file-like objects, e.g. `StringIO`.
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:3>
Comment (by claudep):
Wrapping `StringIO` in a `File` object should work. Report it as a
separate ticket if you can show that it does not.
Maybe the simplest fix would be to wrap `content` in a `File` object if it
has no chunks method. This would preserve compatibility in the case
someone passes a custom `content` instance (which might implement chunks
in a non-standard way).
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:4>
* status: new => assigned
* owner: nobody => biern
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:5>
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/775
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"129d2e8f85b1e80f10ec967b72ba0af9b239019f"]:
{{{
#!CommitTicketReference repository=""
revision="129d2e8f85b1e80f10ec967b72ba0af9b239019f"
Merge pull request #775 from HiddenData/ticket-18899
Fixed #18899 -- FileSystemStorage.save should support any file-like
objects
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"3f16e4df494dc9143d110b886c8e8608f9d2b584" 3f16e4df]:
{{{
#!CommitTicketReference repository=""
revision="3f16e4df494dc9143d110b886c8e8608f9d2b584"
Fixed #27145 -- Updated Storage.save() docs for refs #18899.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"f79dce16bc8b326e1ab61a71f8e841495c52c6ff" f79dce16]:
{{{
#!CommitTicketReference repository=""
revision="f79dce16bc8b326e1ab61a71f8e841495c52c6ff"
[1.10.x] Fixed #27145 -- Updated Storage.save() docs for refs #18899.
Backport of 3f16e4df494dc9143d110b886c8e8608f9d2b584 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/18899#comment:10>