Skip to content


Subversion checkout URL

You can clone with
Download ZIP


TypeError: view() takes exactly 2 arguments (3 given) #503

fafhrd91 opened this Issue · 1 comment

2 participants


pyramid 1.3b3 - - [2012-03-19 19:23:53] "GET /_jca/connection/info HTTP/1.1" 500 161 0.003054
Traceback (most recent call last):
  File "/home/fafhrd/dev/eggs/gevent-1.0b1-py2.7-linux-i686.egg/gevent/", line 449, in handle_one_response
  File "/home/fafhrd/dev/eggs/gevent-1.0b1-py2.7-linux-i686.egg/gevent/", line 435, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/home/fafhrd/dev/eggs/pyramid-1.3b3-py2.7.egg/pyramid/", line 187, in __call__
    response = self.handle_request(request)
  File "/home/fafhrd/dev/eggs/pyramid-1.3b3-py2.7.egg/pyramid/", line 20, in excview_tween
    response = handler(request)
  File "/home/fafhrd/dev/eggs/pyramid_tm-0.3-py2.7.egg/pyramid_tm/", line 61, in tm_tween
    response = handler(request)
  File "/home/fafhrd/dev/eggs/pyramid-1.3b3-py2.7.egg/pyramid/", line 164, in handle_request
    response = view_callable(context, request)
  File "/home/fafhrd/dev/eggs/pyramid-1.3b3-py2.7.egg/pyramid/config/", line 370, in viewresult_to_response
    result = view(context, request)
  File "/home/fafhrd/dev/eggs/pyramid-1.3b3-py2.7.egg/pyramid/config/", line 152, in text_wrapper
    return view(context, request)
TypeError: view() takes exactly 2 arguments (3 given

Example code:

class Foo(object):

  def view(self, request):

obj = Foo()
config.add_view(obj.view, route_name='...')

this code worked in pyramid-1.3b2, regression seems added in #461

@mcdonc mcdonc closed this issue from a commit
@mcdonc mcdonc - The fix for issue #461 (which made
  it possible for instance methods to be used as view callables) introduced a
  backwards incompatibility when methods that declared only a request
  argument were used.  See #503

Fixes #503
@mcdonc mcdonc closed this in 6c15971

Thanks! It's now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.