From 6b00517c84da316271b0cd9cd4320ed13ab26eda Mon Sep 17 00:00:00 2001 From: kageru Date: Wed, 31 Jan 2018 20:04:08 +0100 Subject: [PATCH] fixed tar archive handling --- pyshare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyshare.py b/pyshare.py index 2475bef..366b684 100755 --- a/pyshare.py +++ b/pyshare.py @@ -67,9 +67,9 @@ def ftp_upload(sourcefile, *, mode=None, ext=None) -> tuple: 'screenshot': 'png', 'text': 'txt', } - if re.search('\.tar\.\w{1,4}]', sourcefile): + if re.search('\.tar\.\w{1,4}', sourcefile): # properly handle .tar.something files - ext = sourcefile.split('.')[-2:] + ext = '.'.join(sourcefile.split('.')[-2:]) else: ext = exts.get(mode, mode not in exts and sourcefile.split('.')[-1]) # Only do the split if necessary