Configurator.add_directive should accept arbitrary callables like partials or objects implementing __call__ which dont have __name__ and __doc__ attributes. Currently it is not possible because of sphnix/docutils compatibility code executed upon __getattr__ in pyramid/config/util.py in function action_method where __name__ and __doc__ are copied (line no. 62 and 63) without checking if there are in place first. Suggested resolution would be to check with hasattr if they exist on wrapped callable before attempting copying.
Agreed. pyramid.wsgi.wsgiapp and pyramid.wsgi.wsgiapp2 account for this (they happen to use functools.wraps to get it done). The above-referenced code should do something similar.
Tests for fixing issue #621
Fix for issue #621
All updates push, let me know if you need me to make any other changes.
A fix was committed via 20f2de5...bf64f1e