#10541: cannot save file from a pipe
----------------------------------+-----------------------------------------
Reporter: liangent | Owner: nobody
Status: new | Milestone:
Component: File uploads/storage | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
----------------------------------+-----------------------------------------
code like this:
{{{
r, w = os.pipe()
if os.fork() == 0: # child
os.close(r)
os.dup2(w, sys.stdout.fileno())
print '123'
os.close(w)
os.wait3()
fo = os.fdopen(r, 'rb')
r.s.save('sout', File(fo))
os.close(r)
}}}
the content in pipe cannot be saved. however if i change {{{File(fo)}}} to
{{{ContentFile(fo.read())}}}, it can be saved correctly
--
Ticket URL: <http://code.djangoproject.com/ticket/10541>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---