Skip to content

0.7.0 regression related to passing auth= parameter #254

@eranrund

Description

@eranrund

Hello :)
0.7.0 introduced this commit: 3348380 which introduces a problem if kwargs contains auth.

For example, the Asana python library does this: response = getattr(self.session, method)(url, auth=self.auth, **request_options)
https://github.com/Asana/python-asana/blob/master/asana/client.py#L73

The stack trace this results in looks like this:

TypeError: refresh_token() got multiple values for keyword argument 'auth'
[... stripped internal code... ]
  File "asana/resources/gen/tasks.py", line 25, in create
    return self.client.post("/tasks", params, **options)
  File "asana/client.py", line 124, in post
    return self.request('post', path, data=body, headers={'content-type': 'application/json'}, **options)
  File "asana/client.py", line 74, in request
    response = getattr(self.session, method)(url, auth=self.auth, **request_options)
  File "requests/sessions.py", line 518, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "requests_oauthlib/oauth2_session.py", line 341, in request
    self.auto_refresh_url, auth=auth, **kwargs

I'm assuming it is acceptable to pass an auth parameter. If not, I'll discuss this with the Asana people.

Thanks <3

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