Opened 8 years ago

Closed 8 years ago

#7766 closed (duplicate)

TemporaryFileUploadHandler unlinking files before they are moved

Reported by: screeley Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


First off I'm running Django HEAD on Ubuntu 7.04

I'm running into issues with the Upload File changes as of -r7814

The following lines in /django/db/models/ are causing headaches for files above the FILE_UPLOAD_MAX_MEMORY_SIZE where Django uses the TemporaryFileUploadHandler.

531	            raw_field.close() 
532	            file_move_safe(raw_field.temporary_file_path(), full_filename)

raw_field.close() actually does an unlink on the file and deletes it from my tmp directory and once the file is gone I can no longer move it.

From the tempfile doc: "Returns an object with a file-like interface; the name of the file is accessible as The file will be automatically deleted when it is closed."

I don't really know why this close is in there. It's only used for the TemporaryUploadedFile which is the cause of the issue, InMemory just passes the close.

I would recommend getting rid of the raw_field.close(), but that throws another error that django ignores. I don't know enough about the warnings to guess how to fix that one.


Change History (1)

comment:1 Changed 8 years ago by Karen Tracey <kmtracey@…>

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

This is already reported in #7683

Note: See TracTickets for help on using tickets.
Back to Top