File with multi-byte characters in the filename can not be uploaded.
x in one of the [ ])x in each of the [ ])slackclient version: 2.5.0
python version: 3.8.1
OS version(s): Xubuntu 18.04
client = slack.WebClient(token=MY_TOKEN)
client.files_upload(channels="#random", file="あ.txt")
あ.txt exists in the current directory.
I expected that あ.txt is uploaded.
The following error occurred.
File "/home/vagrant/.pyenv/versions/3.8.1/lib/python3.8/site-packages/slack/web/client.py", line 970, in files_upload
return self.api_call("files.upload", files={"file": file}, data=kwargs)
File "/home/vagrant/.pyenv/versions/3.8.1/lib/python3.8/site-packages/slack/web/base_client.py", line 171, in api_call
return self._event_loop.run_until_complete(future)
File "/home/vagrant/.pyenv/versions/3.8.1/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete
return future.result()
File "/home/vagrant/.pyenv/versions/3.8.1/lib/python3.8/site-packages/slack/web/base_client.py", line 207, in _send
f = open(v.encode("ascii", "ignore"), "rb")
FileNotFoundError: [Errno 2] No such file or directory: b'/home/vagrant/Downloads/.txt'
Thanks again! I'll check this later today.
👋 slackclient 2.6.0rc1 is out. The pre-release version contains fixes for your issue described here.
https://pypi.org/project/slackclient/2.6.0rc1/
One week later from now, we'll be releasing version 2.6.0 to PyPI.
If you have a chance, could you try the release candidate version out and let us know your feedback if you find something wrong with it? Thank you very much for being patient with this issue.