#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 snaury):

 rajeshdhawan, see the patch I have just attached. shutil.move does not
 solve anything either, it just uses shutil.copy2, where the only useful
 part is shutil.copystat. But since file_move_safe is only used by file
 uploads, stat info doesn't matter, and my patch should make things safer
 than shutil.move (shutil.move would also try to recursively move
 directories). Additionally I have patched
 django.core.files.temp.TemporaryFile to be more compatible with
 tempfile._TemporaryFileWrapper implementation. This way .close() will
 (hopefully) delete the file on all platforms. There is a question about
 cygwin though, should django.core.files.temp check for os.platform ==
 'cygwin' as well?

 And I hope my solution is the long term one. :)

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