Skip to content
This repository

Configurator.add_directive should accept arbitrary callables #621

Closed
squeaky-pl opened this Issue June 12, 2012 · 3 comments

3 participants

Squeaky Chris McDonough Wayne Witzel III
Squeaky

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.

Chris McDonough
Owner
mcdonc commented June 13, 2012

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.

Wayne Witzel III wwitzel3 referenced this issue from a commit August 03, 2012
Commit has since been removed from the repository and is no longer available.
Wayne Witzel III wwitzel3 referenced this issue from a commit in wwitzel3/pyramid August 03, 2012
Wayne Witzel III Tests for fixing issue #621 0d8ff5b
Wayne Witzel III wwitzel3 referenced this issue from a commit August 03, 2012
Commit has since been removed from the repository and is no longer available.
Wayne Witzel III wwitzel3 referenced this issue from a commit August 03, 2012
Commit has since been removed from the repository and is no longer available.
Wayne Witzel III wwitzel3 referenced this issue from a commit in wwitzel3/pyramid August 03, 2012
Wayne Witzel III Fix for issue #621 0f0629f
Wayne Witzel III

All updates push, let me know if you need me to make any other changes.

Chris McDonough
Owner

A fix was committed via 20f2de5...bf64f1e

Chris McDonough mcdonc closed this August 24, 2012
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.