#8900: TemporaryFileUploadHandler - Windows Permission Error (ErrNo 13)
----------------------------------------+-----------------------------------
 Reporter:  anonymous                   |       Owner:  nobody    
   Status:  new                         |   Milestone:  post-1.0  
Component:  File uploads/storage        |     Version:  1.0       
 Keywords:  TemporaryFileUploadHandler  |       Stage:  Unreviewed
Has_patch:  0                           |  
----------------------------------------+-----------------------------------
 When I upload files with the TemporaryFileUploadHandler I get a Permission
 Denied Exception.
   82.  try:


 {{{
  83. os.remove(old_file_name) ...

   84. except OSError, e:
   85. # Certain operating systems (Cygwin and Windows)
   86. # fail when deleting opened files, ignore it
   87. if getattr(e, 'winerror', 0) != 32:
   88. # FIXME: should we also ignore errno 13?
   89. raise
 }}}


 So what I get is the errno 13.

 Here is the full stack trace:


 {{{
 Environment:

 Request Method: POST
 Request URL: http://localhost:8000/experiments/3/upload_file/
 Django Version: 1.0-final-SVN-8968
 Python Version: 2.4.0
 Installed Applications:
 ['django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.formtools',
  'django.contrib.markup',
  'sites',
  'experiments']
 Installed Middleware:
 ('django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.middleware.doc.XViewMiddleware',
  'django.middleware.transaction.TransactionMiddleware')


 Traceback:
 File "C:\Programme\Python24\lib\site-
 packages\django\core\handlers\base.py" in get_response
   86.                 response = callback(request, *callback_args,
 **callback_kwargs)
 File "D:\projects\openContext\src\experiments\views.py" in upload_file
   105.             datafile.file.save(filename, request.FILES['file'],
 save=False)
 File "C:\Programme\Python24\lib\site-
 packages\django\db\models\fields\files.py" in save
   74.         self._name = self.storage.save(name, content)
 File "C:\Programme\Python24\lib\site-
 packages\django\core\files\storage.py" in save
   45.         name = self._save(name, content)
 File "C:\Programme\Python24\lib\site-
 packages\django\core\files\storage.py" in _save
   150.                     file_move_safe(content.temporary_file_path(),
 full_path)
 File "C:\Programme\Python24\lib\site-packages\django\core\files\move.py"
 in file_move_safe
   83.         os.remove(old_file_name)

 Exception Type: OSError at /experiments/3/upload_file/
 Exception Value: [Errno 13] Permission denied:
 'D:\\projects\\openContext\\htdocs\\media\\temp\\_5xns1.upload'
 }}}

 -Toni

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