Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot handle *args, **kwargs decorators #48

Open
dstufft opened this issue Apr 23, 2018 · 0 comments
Open

Cannot handle *args, **kwargs decorators #48

dstufft opened this issue Apr 23, 2018 · 0 comments

Comments

@dstufft
Copy link
Contributor

dstufft commented Apr 23, 2018

When attempting to wrap the view functions in a normal Python decorator (e.g. not a pyramid style decorator) that utilizes the *args, **kwargs pattern, pyramid_rpc breaks due to the inability to determine the number of arguments. This is true even if the decorator is using functools.wraps, which on Python 3 is smart enough to keep the function signature the same.

From digging into this, it appears this is because pyramid_rpc pokes at the code object directly instead of using a smarter helper function.

The context for this is wanting to use the @typechecked decorator from typeguard so that parameters passed from the client are type checked and generate an XMLRPC level error, instead of raising an unhandled exception (which typically get logged into something like Sentry).

However, attempting to use that results in an exception: ViewMapperArgsInvalid('too many arguments').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant