#16108: File removal race condition in FileSystemStorage
-------------------------------------+-------------------------------------
     Reporter:  aaugustin            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  File                 |                  Version:  1.3
  uploads/storage                    |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  FileSystemStorage    |             Triage Stage:  Ready for
  file deletion race condition       |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by freshquiz):

 * cc: piethon@… (added)


Comment:

 Why is the:
 {{{
     if os.path.exists(name):
 }}}
 ...line needed?

 That line tells me that an exception should not be raised if the file does
 not exist and yet in the `except` clause, an exception is raised if the
 file was deleted before this thread could do it.

 Why the mixed messages and why can't we just have this:
 {{{
 try:
     os.remove(name)
 except OSError:
     pass
 }}}
 ?

--
Ticket URL: <https://code.djangoproject.com/ticket/16108#comment:9>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.17de893e31b7b99e70437ef3c9fa5f7c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to