Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13111 closed (fixed)

1.1.X: decorators broken by r12763

Reported by: kmtracey Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Since r12763 we're getting about 100 test errors on the 1.1.X branch, all (I'm guessing, I did not actually look at them all) like this:

======================================================================
ERROR: test_callable_process_view_middleware (regressiontests.utils.decorators.DecoratorFromMiddlewareTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/tests/regressiontests/utils/decorators.py", line 19, in test_callable_process_view_middleware
    self.client.get('/utils/class_xview/')
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/test/client.py", line 281, in get
    response = self.request(**r)
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/core/handlers/base.py", line 89, in get_response
    callback, callback_args, callback_kwargs = resolver.resolve(
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/core/urlresolvers.py", line 222, in resolve
    sub_match = pattern.resolve(new_path)
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/core/urlresolvers.py", line 220, in resolve
    for pattern in self.url_patterns:
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/core/urlresolvers.py", line 249, in _get_url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/core/urlresolvers.py", line 244, in _get_urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/tests/regressiontests/utils/urls.py", line 3, in ?
    import views
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/tests/regressiontests/utils/views.py", line 17, in ?
    class_xview = xview_dec(ClassXView())
  File "/home/buildbot/slave-py2.4/parts/ubuntu9.10-py2.4-sqlite/django-1.1.X_ubuntu9.10-py2.4-sqlite/build/django/utils/decorators.py", line 37, in _decorator_from_middleware
    middleware = middleware_class(*args, **kwargs)
TypeError: default __new__ takes no parameters

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by kmtracey

(In [12776]) [1.1.X] Revert r12763 until we figure out what's wrong with it on 1.1.X. Refs #13111.

comment:2 Changed 4 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

For now I've reverted the revision, so I can see if the 3 failures being reported are due to it also or are some other problem.

comment:3 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

Digging into this a big more, I think this was an overenthusiastic backmerge on my part.

The original problem from #13093 only deals with decorated class-like views. [12399] made some pretty big changes to decorator_from_middleware, in turn fixing problems introduced by [11586], which was addressing problems decorating bound methods rather than functions.

Effectively, this means that there was no way to decorate a class-like view in Django 1.1 -- at least, not with the Django-provided utilities. Therefore, a backport of [12763] isn't required.

Apologies for the temporary instability on 1.1.X; I'm going to close this fixed, as the revert from [12776] is what was required.

comment:4 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.