#36191: FileSystemStorage with allow_overwrite=True does not truncate previous 
file
------------------------+------------------------------------------------
     Reporter:  gutard  |                     Type:  Bug
       Status:  new     |                Component:  File uploads/storage
      Version:  5.1     |                 Severity:  Normal
     Keywords:          |             Triage Stage:  Unreviewed
    Has patch:  0       |      Needs documentation:  0
  Needs tests:  0       |  Patch needs improvement:  0
Easy pickings:  0       |                    UI/UX:  0
------------------------+------------------------------------------------
 The new allow_overwrite parameter of FileSystemStorage class allows to
 overwrite an existing file. However, the previous file is not truncated.
 So, if the previous file was bigger than the new, the file gets corrupted.

 It is possible to workaround with :
 {{{
 storage.OS_OPEN_FLAGS = storage.OS_OPEN_FLAGS & ~os.O_EXCL | os.O_TRUNC
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36191>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019509f4c68d-13bc2c22-61ea-4a5d-ae0c-d79dc128a075-000000%40eu-central-1.amazonses.com.

Reply via email to