Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Configurator.add_directive should accept arbitrary callables #621

Closed
squeaky-pl opened this Issue · 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

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
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
Wayne Witzel III wwitzel3 Tests for fixing issue #621 0d8ff5b
Wayne Witzel III wwitzel3 referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Wayne Witzel III wwitzel3 referenced this issue from a commit
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
Wayne Witzel III wwitzel3 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
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.