mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 08:49:30 -05:00
fixed OSX filename-related issues
This commit is contained in:
parent
10a53cad48
commit
b035330805
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user