#8900 closed (fixed)
TemporaryFileUploadHandler - Windows Permission Error (ErrNo 13)
| Reported by: | anonymous | Owned by: | Karen Tracey |
|---|---|---|---|
| Component: | File uploads/storage | Version: | 1.0 |
| Severity: | Keywords: | TemporaryFileUploadHandler | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When I upload files with the TemporaryFileUploadHandler I get a Permission Denied Exception.
- 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
Change History (5)
comment:1 by , 17 years ago
| milestone: | post-1.0 |
|---|
comment:2 by , 17 years ago
| milestone: | → 1.1 |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
I guess we should ignore errno 13, too.
comment:3 by , 17 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
I've got Windows and this is causing test suite failures I can see on Python 2.3 and Python 2.4 so I'll fix it.
comment:4 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Milestone post-1.0 deleted