[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] v2 Add archive support to hot-backup

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-02-28 09:36:54 CET

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.