Skip to content

TypeError - decode() argument 'encoding' must be str, not None #829

@adamchainz

Description

@adamchainz

It seems slack just had a blip and returned some kind of error responses that did not feature the charset header. This broke in the SDK with:

TypeError - decode() argument 'encoding' must be str, not None

On this line:

https://github.com/slackapi/python-slackclient/blob/5a2c80eb78fa82c2805251a60bc3e0eccb0b1269/slack/web/base_client.py#L489

From the Sentry local-caputring I can see charset was None - in typing terms it's Optional[str] being used as a str.

Reproducible in:

Requires slack returning these unexpected responses, or simulating them

The Slack SDK version

2.9.1

Python runtime version

3.8.5

OS info

Linux

Steps to reproduce:

As above

Expected result:

Some kind of fallback decoding?

Actual result:

TypeError raised

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions