I hope it finally is right.

This commit is contained in:
Mattias Põldaru 2011-03-09 21:22:52 +02:00
parent 89187ffade
commit f117446954

View File

@ -465,6 +465,7 @@ class ServiceManager(QtGui.QWidget):
allow_zip_64 = (total_size > 2147483648 + len(service_content)) allow_zip_64 = (total_size > 2147483648 + len(service_content))
log.debug(u'ServiceManager.saveFile - allowZip64 is %s' % log.debug(u'ServiceManager.saveFile - allowZip64 is %s' %
allow_zip_64) allow_zip_64)
zip = None
try: try:
zip = zipfile.ZipFile(path_file_name, 'w', zipfile.ZIP_STORED, zip = zipfile.ZipFile(path_file_name, 'w', zipfile.ZIP_STORED,
allow_zip_64) allow_zip_64)
@ -477,13 +478,13 @@ class ServiceManager(QtGui.QWidget):
zip.write(path_from, path_from.encode(u'utf-8')) zip.write(path_from, path_from.encode(u'utf-8'))
except IOError: except IOError:
log.exception(u'Failed to save service to disk') log.exception(u'Failed to save service to disk')
zip.close()
return False return False
finally: finally:
zip.close() if zip:
self.mainwindow.addRecentFile(path_file_name) zip.close()
self.setModified(False) self.mainwindow.addRecentFile(path_file_name)
return True self.setModified(False)
return True
def saveFileAs(self): def saveFileAs(self):
""" """