fixed OSX filename-related issues

This commit is contained in:
Micah Lee 2014-09-25 11:42:29 -07:00
parent 10a53cad48
commit b035330805
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)