Skip to content

asyncio RuntimeError stacktrace in SlackResponse, when getting paginated responses #626

@ryan-lane

Description

@ryan-lane

Description

I'm trying to get paginated responses in users_list, by providing cursor and limit, but I'm getting a RuntimeError when doing so, because there's no existing asyncio loop in the thread:

https://github.com/slackapi/python-slackclient/blob/e06b4d7b415aac439ec9d5456ef756aaed4083e9/slack/web/slack_response.py#L135

Applying the same pattern that base client uses for getting an event loop fixes the issue:

https://github.com/slackapi/python-slackclient/blob/e06b4d7b415aac439ec9d5456ef756aaed4083e9/slack/web/base_client.py#L49-L56

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

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version: 2.5.0

python version: 3.x

OS version(s): Ubuntu bionic

Steps to reproduce:

  1. Try to get a paginated response without generating an event loop (my code doesn't use asyncio)
  2. Try to get a paginated response
  3. Get a stacktrace

Expected result:

I expect to get paginated results.

Actual result:

I get a RuntimeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Version: 2xarea:concurrencyIssues and PRs related to concurrencyneeds infoAn issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more infoweb-client

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions