Opened 19 years ago
Closed 14 years ago
#2115 closed defect (fixed)
'tuple' object has no attribute 'startswith'
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the last development version,
Inthe admin interface
in ImageField, when you trie to modify an file(upload another) send the next error(sorry my english),
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/base.py" in get_response
- response = callback(request, *callback_args, callback_kwargs)
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/admin/views/decorators.py" in _checklogin
- return view_func(request, *args, kwargs)
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/views/decorators/cache.py" in _wrapped_view_func
- response = view_func(request, *args, kwargs)
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/admin/views/main.py" in change_stage
- errors = manipulator.get_validation_errors(new_data)
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/forms/init.py" in get_validation_errors
- errors.update(field.get_validation_errors(new_data))
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/forms/init.py" in get_validation_errors
- self.run_validator(new_data, validator)
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/forms/init.py" in run_validator
- validator(new_data.get(self.field_name, ), new_data)
File "/usr/lib64/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/models/fields/init.py" in isWithinMediaRoot
- if not f.startswith(os.path.normpath(settings.MEDIA_ROOT)):
File "/usr/lib64/python2.4/posixpath.py" in normpath
- initial_slashes = path.startswith('/')
AttributeError at /admin/cotix/producto/1/
'tuple' object has no attribute 'startswith'
Change History (4)
comment:1 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
comment:4 by , 14 years ago
Easy pickings: | unset |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
I have the same problem. My media_root is MEDIA_ROOT = path.join(BASEDIR, 'media/')
.
comment:5 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The problem was that I had two different versions of tagging package, and I was ussing the older one. Now I've updated my tagging package version to 0.3.1 and it works.
Have a look in your settings.py file and check that the MEDIA_ROOT line does not end with a comma. It looks like you are passing in a one-tuple, rather than a string, based on the error message.
If that is not the case, please reopen this and paste the MEDIA_ROOT value from your settings file. But at the moment, it looks like a configuration problem.