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

0.7.0 regression related to passing auth= parameter #254

Closed
eranrund opened this issue Oct 4, 2016 · 2 comments
Closed

0.7.0 regression related to passing auth= parameter #254

eranrund opened this issue Oct 4, 2016 · 2 comments

Comments

@eranrund
Copy link

eranrund commented Oct 4, 2016

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

@Lukasa
Copy link
Member

Lukasa commented Oct 12, 2016

Yeah, this code should probably be more defensive against users passing in auth values from above. @singingwolfboy are you interested in correcting this regression?

@eranrund
Copy link
Author

Thanks :)

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

2 participants