Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Comments

[FIX] TypeError on LambdaClient(transport=...)#1225

Merged
ashwoods merged 1 commit intogetsentry:masterfrom
alanjds:patch-1
May 19, 2018
Merged

[FIX] TypeError on LambdaClient(transport=...)#1225
ashwoods merged 1 commit intogetsentry:masterfrom
alanjds:patch-1

Conversation

@alanjds
Copy link
Contributor

@alanjds alanjds commented Apr 18, 2018

Fixes for TypeError: __init__() got multiple values for keyword argument 'transport'

The code o LambdaClient would error if transport is provided:

>>> LambdaClient(transport='ANYTHING')
Traceback (most recent call last):
  File "<ipython-input-15-12899bb0d00a>", line 1, in <module>
    LambdaClient(transport='ANYTHING')
  File "/Users/alanjds/.virtualenvs/sandbox36/lib/python3.6/site-packages/raven/contrib/awslambda/__init__.py", line 58, in __init__
    super(LambdaClient, self).__init__(*args, transport=transport, **kwargs)
TypeError: __init__() got multiple values for keyword argument 'transport'

The culprit is:

transport = kwargs.get('transport', HTTPTransport)

Because it get()s instead of pop(), **kwargs will keeps transport kw and will be provided 2 times:

super(LambdaClient, self).__init__(*args, transport=transport, **kwargs)

TypeError: __init__() got multiple values for keyword argument 'transport'

Because it has `get()`ing the 'transport' keyword, instead of `pop()`ing it.
@ashwoods ashwoods merged commit d240cf8 into getsentry:master May 19, 2018
@ashwoods
Copy link
Contributor

thx!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants