diff options
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 3419719..e29b463 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -4097,8 +4097,12 @@ def command_upload(data, current_buffer, args): return w.WEECHAT_RC_ERROR if not os.path.isfile(file_path): - w.prnt('', 'ERROR: Could not find file: {}'.format(file_path)) - return w.WEECHAT_RC_ERROR + unescaped_file_path = file_path.replace(r'\ ', ' ') + if os.path.isfile(unescaped_file_path): + file_path = unescaped_file_path + else: + w.prnt('', 'ERROR: Could not find file: {}'.format(file_path)) + return w.WEECHAT_RC_ERROR post_data = { 'channels': channel.identifier, |