From b035330805a5cbe603ca8a7716bf1f76e054f619 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 25 Sep 2014 11:42:29 -0700 Subject: [PATCH] fixed OSX filename-related issues --- onionshare/helpers.py | 2 +- onionshare/web.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onionshare/helpers.py b/onionshare/helpers.py index 66e94c1e..4555f7ba 100644 --- a/onionshare/helpers.py +++ b/onionshare/helpers.py @@ -110,7 +110,7 @@ class ZipWriter(object): self.z.write(filename, os.path.basename(filename), zipfile.ZIP_DEFLATED) def add_dir(self, filename): - dir_to_strip = os.path.dirname(filename)+'/' + dir_to_strip = os.path.dirname(filename.rstrip('/'))+'/' for dirpath, dirnames, filenames in os.walk(filename): for f in filenames: full_filename = os.path.join(dirpath, f) diff --git a/onionshare/web.py b/onionshare/web.py index fabf6f12..9a8b28b8 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -36,7 +36,7 @@ def set_file_info(filenames): for filename in filenames: info = { 'filename': filename, - 'basename': os.path.basename(filename) + 'basename': os.path.basename(filename.rstrip('/')) } if os.path.isfile(filename): info['size'] = os.path.getsize(filename)