Skip to content

WebClient's paginated API calls may fail with no params (v2.6.0+) #705

@seratch

Description

@seratch

Description

Since version 2.6.0, WebClient w/ run_async=False may fail during paginated API calls only when the call doesn't have any params.

from slack import WebClient
client = WebClient(token="xoxb-***")
all = []
for page in client.conversations_list():
    all = all + page["channels"] # only when there are 100+ channels in the workspace
  File "/path-to-project/env/lib/python3.8/site-packages/slack/web/slack_response.py", line 134, in __next__
    self.req_args.get("params", {}).update(
AttributeError: 'NoneType' object has no attribute 'update'

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: v2.6.0+
  • python version: any
  • OS version(s): any

Steps to reproduce:

from slack import WebClient
client = WebClient(token="xoxb-***")
all = []
for page in client.conversations_list():
    all = all + page["channels"] # only when there are 100+ channels in the workspace
  File "/path-to-project/env/lib/python3.8/site-packages/slack/web/slack_response.py", line 134, in __next__
    self.req_args.get("params", {}).update(
AttributeError: 'NoneType' object has no attribute 'update'

Expected result:

Successful pagination.

Actual result:

WebClient raises an error when fetching the second page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Version: 2xbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedsemver:patchweb-client

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions