From a8052886e79091c66fb6c8152b4d57c43a861dba Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 5 Jan 2021 16:19:43 +0900 Subject: [PATCH] Fix #901 by correcting type hints for files_upload method args --- slack_sdk/web/async_client.py | 2 +- slack_sdk/web/client.py | 2 +- slack_sdk/web/legacy_client.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/slack_sdk/web/async_client.py b/slack_sdk/web/async_client.py index 4295e2292..ecc78346d 100644 --- a/slack_sdk/web/async_client.py +++ b/slack_sdk/web/async_client.py @@ -1549,7 +1549,7 @@ async def files_sharedPublicURL(self, *, file: str, **kwargs) -> AsyncSlackRespo return await self.api_call("files.sharedPublicURL", json=kwargs) async def files_upload( - self, *, file: Union[str, IOBase] = None, content: str = None, **kwargs + self, *, file: Union[str, bytes, IOBase] = None, content: str = None, **kwargs ) -> AsyncSlackResponse: """Uploads or creates a file. diff --git a/slack_sdk/web/client.py b/slack_sdk/web/client.py index e5477bc3c..b748f51b6 100644 --- a/slack_sdk/web/client.py +++ b/slack_sdk/web/client.py @@ -1456,7 +1456,7 @@ def files_sharedPublicURL(self, *, file: str, **kwargs) -> SlackResponse: return self.api_call("files.sharedPublicURL", json=kwargs) def files_upload( - self, *, file: Union[str, IOBase] = None, content: str = None, **kwargs + self, *, file: Union[str, bytes, IOBase] = None, content: str = None, **kwargs ) -> SlackResponse: """Uploads or creates a file. diff --git a/slack_sdk/web/legacy_client.py b/slack_sdk/web/legacy_client.py index e966f1f7c..22884a4d3 100644 --- a/slack_sdk/web/legacy_client.py +++ b/slack_sdk/web/legacy_client.py @@ -1549,7 +1549,7 @@ def files_sharedPublicURL( return self.api_call("files.sharedPublicURL", json=kwargs) def files_upload( - self, *, file: Union[str, IOBase] = None, content: str = None, **kwargs + self, *, file: Union[str, bytes, IOBase] = None, content: str = None, **kwargs ) -> Union[Future, SlackResponse]: """Uploads or creates a file.