#7766: TemporaryFileUploadHandler unlinking files before they are moved
---------------------------+------------------------------------------------
 Reporter:  screeley       |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  SVN       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 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/base.py 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 file.name.  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.

 Thanks!

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7766>
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