On Tue, 28 Feb 2006, Daniel Rall wrote:
...
> > + print "Archiving backup to '" + archive_path + "'..."
> > + if archive == 'gz' or archive == 'bz2':
> > + try:
> > + import tarfile
> > + tar = tarfile.open(archive_path, 'w:' + archive)
> > + tar.add(backup_subdir, os.path.basename(backup_subdir))
> > + tar.close()
> > + except ImportError, e:
> > + err_msg = "Import failed: " + str(e)
> > + err_code = -2
> > + except tarfile.TarError, e:
> > + err_msg = "Tar failed: " + str(e)
> > + err_code = -3
>
> There should be two separate try/except blocks here, the first around
> the "import tarfile" statement, and the second around the remainder of
> the existing "try" block.
Scratch that, tarfile.py embeds a ton of possible runtime
ImportErrors, long after the tarfile module has been imported.
--
Daniel Rall
- application/pgp-signature attachment: stored
Received on Tue Feb 28 09:38:47 2006