#12019: @cache_page with no args causes AttributeError with wsgi -----------------------------------+---------------------------------------- Reporter: rokclimb15 | Owner: nobody Status: new | Milestone: Component: Cache system | Version: 1.1 Resolution: | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | -----------------------------------+---------------------------------------- Changes (by Alex):
* needs_better_patch: => 0 * needs_tests: => 0 * needs_docs: => 0 Old description: > When calling @cache_page with no arguments I get the following exception > while running mod_wsgi. I'm not sure if that usage is valid. I would > assume it would use CACHE_MIDDLEWARE_SECONDS if nothing is provided, but > I can't find anything about that in docs or see any evidence of that in > the code. If that argument is required, I think a clear exception should > be thrown rather than this one when running under mod_wsgi. > > Traceback (most recent call last): > > File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py", > line 92, in get_response > response = callback(request, *callback_args, **callback_kwargs) > > File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py", line > 33, in adapt > return MethodDecoratorAdaptor(decorator, func) > > File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py", line > 15, in __init__ > update_wrapper(self, func) > > File "/usr/lib/python2.6/functools.py", line 33, in update_wrapper > setattr(wrapper, attr, getattr(wrapped, attr)) > > AttributeError: 'WSGIRequest' object has no attribute '__name__' New description: When calling @cache_page with no arguments I get the following exception while running mod_wsgi. I'm not sure if that usage is valid. I would assume it would use CACHE_MIDDLEWARE_SECONDS if nothing is provided, but I can't find anything about that in docs or see any evidence of that in the code. If that argument is required, I think a clear exception should be thrown rather than this one when running under mod_wsgi. {{{ Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py", line 92, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py", line 33, in adapt return MethodDecoratorAdaptor(decorator, func) File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py", line 15, in __init__ update_wrapper(self, func) File "/usr/lib/python2.6/functools.py", line 33, in update_wrapper setattr(wrapper, attr, getattr(wrapped, attr)) AttributeError: 'WSGIRequest' object has no attribute '__name__' }}} Comment: Please use preview. -- Ticket URL: <http://code.djangoproject.com/ticket/12019#comment:1> Django <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 django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---