#8203: File Storage can't delete temporary uploaded files in Windows
-------------------------------------------+--------------------------------
          Reporter:  julien                |         Owner:  nobody
            Status:  new                   |     Milestone:  1.0   
         Component:  File uploads/storage  |       Version:  SVN   
        Resolution:                        |      Keywords:        
             Stage:  Accepted              |     Has_patch:  1     
        Needs_docs:  0                     |   Needs_tests:  1     
Needs_better_patch:  1                     |  
-------------------------------------------+--------------------------------
Comment (by rajeshdhawan):

 snaury, you're right that this patch screws things up on all other
 platforms. Your suggested os.rename based code would still not solve the
 problem because:

 1. os.rename breaks when moving across filesystems (as opposed to
 shutils.move) and
 2. the following fragment in storage.FileSystemStorage._save is still
 trying to move a file which is open and whose contents may not yet have
 been flushed to disk. So, I think that os.rename won't be able to move
 this file while it's in use.

 {{
                 if hasattr(content, 'temporary_file_path'):
                     file_move_safe(content.temporary_file_path(),
 full_path)
                     content.close()
 }}

 I too am looking into this further. I think we need a short term solution
 as well as a long term one. The short term solution is needed for Windows
 users because without it a lot of file upload related stuff breaks. Don't
 know what exactly the long term solution would be.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8203#comment:13>
Django Code <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
-~----------~----~----~----~------~----~------~--~---

Reply via email to