Pylons/pyramid — Issue #461: config.add_view(<instancemethod>) raises AttributeError for __text__
Author: hlv42
Created: 2012-03-05 22:05:22+00:00
State: open

## bug

using

config.add_view(self.somemethod, route_name="something")

raises

```
pyramid.exceptions.ConfigurationExecutionError: : 'instancemethod' object has no attribute '__text__'
in:
Line 14 of file helloworld.bugdemo.py:
config.add_view(f.hello_world, route_name='hello')
```

## workaround:
a workaround until this is fixed can be done by changing to:
config.add_view(self, attr="somemethod", route_name="something")

## complete traceback:
```
Traceback (most recent call last):
File "helloworld.bugdemo.py", line 15, in
app = config.make_wsgi_app()
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/__init__.py", line 921, in make_wsgi_app
self.commit()
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/__init__.py", line 594, in commit
self.action_state.execute_actions(introspector=self.introspector)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/__init__.py", line 1049, in execute_actions
tb)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/__init__.py", line 1041, in execute_actions
callable(*args, **kw)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/views.py", line 1087, in register
derived_view = deriver(view)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/views.py", line 142, in __call__
self.mapped_view(view)))))))))
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/views.py", line 87, in inner
wrapper_view = wrapper(self, view)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/views.py", line 154, in mapped_view
mapped_view = mapper(**self.kw)(view)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/views.py", line 395, in __call__
view = self.map_nonclass(view)
File "/home/dev/www/env/lib/python2.6/site-packages/pyramid/config/views.py", line 426, in map_nonclass
mapped_view.__text__ = object_description(view)
pyramid.exceptions.ConfigurationExecutionError: : 'instancemethod' object has no attribute '__text__'
in:
Line 14 of file helloworld.bugdemo.py:
config.add_view(f.hello_world, route_name='hello')
```