5366: When doing a backup to a non existing directory, the error msg box is unreadable Only the first characters are shown

svn: r18701
This commit is contained in:
Michiel Nauta 2012-01-04 18:42:22 +00:00
parent 8275c82787
commit aa4285509c
2 changed files with 8 additions and 3 deletions

View File

@ -1574,13 +1574,13 @@ class ViewManager(CLIManager):
if include.get_active():
from ExportPkg import PackageWriter
writer = PackageWriter(self.dbstate.db, filename,
msg_callback=lambda m1, m2: ErrorDialog(m1[0], m1[1]),
msg_callback=lambda m1, m2: ErrorDialog(m1, m2),
callback=self.pulse_progressbar)
writer.export()
else:
from ExportXml import XmlWriter
writer = XmlWriter(self.dbstate.db,
msg_callback=lambda m1, m2: ErrorDialog(m1[0], m1[1]),
msg_callback=lambda m1, m2: ErrorDialog(m1, m2),
callback=self.pulse_progressbar,
strip_photos=0, compress=1)
writer.write(filename)

View File

@ -176,7 +176,12 @@ class PackageWriter(object):
fs_top.destroy()
#---------------------------------------------------------------
archive = tarfile.open(self.filename,'w:gz')
try:
archive = tarfile.open(self.filename,'w:gz')
except EnvironmentError, msg:
log.warn(str(msg))
self.msg_callback(_('Failure writing %s') % self.filename, str(msg))
return 0
# Write media files first, since the database may be modified
# during the process (i.e. when removing object)