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

users_list method fails with KeyError: 'auth' to get multiple pages #535

Closed
4 of 9 tasks
HASHIMOTO-Takafumi opened this issue Oct 10, 2019 · 3 comments
Closed
4 of 9 tasks
Assignees
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 2x

Comments

@HASHIMOTO-Takafumi
Copy link

Description

users_list fails to get multiple pages in 2.2.1.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Reproducible in:

slackclient version: 2.2.1

python version: 3.7.2

OS version(s): Ubuntu 18.04.3 LTS x86_64 (in VirtualBox 6.0.10 for Windows 10)

Steps to reproduce:

import slack

client = slack.WebClient(API_TOKEN)
for page in client.users_list(limit=1):    # small limit to impose multiple pages
    for member in page['members']:
        print(member['name'])

Expected result:

Output all user names.

Actual result:

slackbot
Traceback (most recent call last):
  File "foo.py", line 4, in <module>
    for page in client.users_list(limit=1):
  File "/home/foo/.pyenv/versions/3.7.2/lib/python3.7/site-packages/slack/web/slack_response.py", line 139, in __next__
    req_args=self.req_args,
  File "/home/foo/.pyenv/versions/3.7.2/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/foo/.pyenv/versions/3.7.2/lib/python3.7/site-packages/slack/web/base_client.py", line 258, in _request
    auth=req_args.pop("auth"),
KeyError: 'auth'

The first user (slackbot) in the first page is fetched correctly, but slackclient fails to go on to the second page.

Attachments:

@RodneyU215 RodneyU215 added Priority: High bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 2x labels Oct 10, 2019
@RodneyU215 RodneyU215 self-assigned this Oct 10, 2019
@RodneyU215
Copy link
Contributor

Thanks for reporting this issue. I believe I know the cause of this issue. I'll work on getting a patch out today.

@RodneyU215
Copy link
Contributor

@HASHIMOTO-Takafumi I've just released an update to address this. I apologize it's taken me longer than anticipated. I hope this helps. If you have any additional issues please let me know.

@HASHIMOTO-Takafumi
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 2x
Projects
None yet
Development

No branches or pull requests

2 participants