Skip to content

TypeError when updating webhooks #591

@alexei

Description

@alexei

Code is basically:

stripe.WebhookEndpoint.modify(hook['id'], url=url)

Fails with:

Traceback (most recent call last):
  [...snip...]
  File "stripe/api_resources/abstract/updateable_api_resource.py", line 12, in modify
    return cls._static_request("post", url, **params)
TypeError: _static_request() got multiple values for keyword argument 'url'

That's because stripe.api_resources.abstract.api_resource.APIResource._static_request accepts a url argument which conflicts with the url kwarg required for hooks:

>>> def foo(bar, **kwargs):
...     pass
... 
>>> foo('a bar', bar='another bar')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: foo() got multiple values for keyword argument 'bar'

Fwiw, using stripe==2.31.0 on Python 2.7.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions