diff options
author | Justin Lewis <jtl1728@rit.edu> | 2010-01-18 15:47:53 (GMT) |
---|---|---|
committer | Justin Lewis <jtl1728@rit.edu> | 2010-01-18 15:47:53 (GMT) |
commit | 852aaad83bab7b110eb3da37b53515bf58aff298 (patch) | |
tree | 57e84903238ce35a299328a90f907ae062b87cae | |
parent | 0c632407f6f7a6a7da3564074049e981b4c261ed (diff) |
Fixed bug in blueberry that crashed when packaging file.
This is caused by the zip lib it is using, when trying to append to an
empty zip file it would crash. Solution: put that in try block and just
wipe out the existing zip file if it can't append to it.
-rw-r--r-- | FileShare.activity/journalentrybundle.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/FileShare.activity/journalentrybundle.py b/FileShare.activity/journalentrybundle.py index a302b81..f8f9d26 100644 --- a/FileShare.activity/journalentrybundle.py +++ b/FileShare.activity/journalentrybundle.py @@ -82,7 +82,10 @@ class JournalEntryBundle(Bundle): return zip_root_dir def set_entry_id(self, entry_id): - zip_file = zipfile.ZipFile(self._path,'a') + try: + zip_file = zipfile.ZipFile(self._path,'a') + except: + zip_file = zipfile.ZipFile(self._path,'w') file_names = zip_file.namelist() if len(file_names) == 0: base_dir = zipfile.ZipInfo(entry_id + '/') |