aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2017-01-26 08:52:47 -0800
committerGitHub <noreply@github.com>2017-01-26 08:52:47 -0800
commit272da50483ea5e65ab19869f80c499c073d3897d (patch)
tree428d59c92c4a993414d22df0bf7f24bb8f51bb9d /wee_slack.py
parente3a408db31bba9c05301b3ee96df0d319c0cf03b (diff)
parentbac506e120f5eeb853447645d29c6cce61378603 (diff)
downloadwee-slack-272da50483ea5e65ab19869f80c499c073d3897d.tar.gz
Merge pull request #296 from lchausmann/master
Handles upload with spaces in filename
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 3a5d95a..17615a4 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2256,6 +2256,8 @@ def async_slack_api_upload_request(token, request, post_data, priority=False):
if not STOP_TALKING_TO_SLACK:
url = 'https://slack.com/api/{}'.format(request)
file_path = os.path.expanduser(post_data["file"])
+ if ' ' in file_path:
+ file_path = file_path.replace(' ','\ ')
command = 'curl -F file=@{} -F channels={} -F token={} {}'.format(file_path, post_data["channels"], token, url)
context = pickle.dumps({"request": request, "token": token, "post_data": post_data})
w.hook_process(command, slack_timeout, "url_processor_cb", context)