Exception Type: TypeError
Exception Value: readonly attribute
Exception Location:
/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/contrib/auth/decorators.py
in _dec, line 18
Traceback (most recent call last):
File
"/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/handlers/base.py"
in get_response
65. callback, callback_args, callback_kwargs = resolver.resolve(path)
File
"/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/urlresolvers.py"
in resolve
147. sub_match = pattern.resolve(new_path)
File
"/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/urlresolvers.py"
in resolve
112. self.func = self.get_callback()
File
"/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/urlresolvers.py"
in get_callback
118. return getattr(__import__(mod_name, '', '', ['']), func_name)
File
"/home/hukka/work/programs/django/teekkarikyla/../teekkarikyla/kirjasto/views.py"
in ?
54. add_book = login_required(add_book)
File
"/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/contrib/auth/decorators.py"
in _dec
18. _checklogin.__name__ = view_func.__name__
TypeError at /accounts/verify/
readonly attribute
If I reload the page, the error changes into:
Exception Type: ViewDoesNotExist
Exception Value: Tried verify in module teekkarikyla.kirjasto.views.
Error was: 'module' object has no attribute 'verify'
Exception Location:
/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/urlresolvers.py
in get_callback, line 122
I can get back to TypeError by restarting my server. Running Django on
the internal server on Debian unstable's Python2.3.
If "readonly attribute" is to be believed, then I *think* __name__ is
readonly. This confirms it:
>>> def foo():
... pass
...
>>> foo.__name__ = "bar"
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: readonly attribute
Switching to Python 2.4.3 solved the problem for me.
I've reverted the assignment of __name__ -- thanks for pointing this
out! Looks to be a problem with different behavior across Python
versions, perhaps?
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
> I've reverted the assignment of __name__ -- thanks for pointing this
> out! Looks to be a problem with different behavior across Python
> versions, perhaps?
>
Yep, see http://www.python.org/download/releases/2.4/notes/#what-s-new-in-python-2-4-alpha-3
Jay P.