From d33f55103cde72d2d769b7e6ce2ddafde540cace Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 4 Jun 2011 20:32:50 +0200 Subject: [PATCH] fixed crash when a source dir can't be accessed --- gcp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcp b/gcp index 55a47ec..4ccd85a 100755 --- a/gcp +++ b/gcp @@ -272,7 +272,12 @@ class GCP(): else: self.__appendToList(filepath, dest_path, options) except OSError,e: - error(_("Can't append %(path)s to copy list: %(exception)s") % {'path':filepath.decode('utf-8','replace'), + try: + error(_("Can't append %(path)s to copy list: %(exception)s") % {'path':filepath.decode('utf-8','replace'), + 'exception':e.strerror}) + except NameError: + #We can't list the dir + error(_("Can't access %(dirpath)s: %(exception)s") % {'dirpath':dirpath.decode('utf-8','replace'), 'exception':e.strerror}) def __checkArgs(self, options, source_path, args):