# HG changeset patch
# User Goffi <goffi@goffi.org>
# Date 1307213916 -7200
# Node ID 99da6ef26d2687e05df15abcd60b18b19f61a4e7
# Parent  dda2195dc9f41a5ea8e77c04ba4da0b62de1b473
fixed crash when source file can't be opened

diff -r dda2195dc9f4 -r 99da6ef26d26 gcp
--- a/gcp	Sat Jun 04 20:55:44 2011 +0200
+++ b/gcp	Sat Jun 04 20:58:36 2011 +0200
@@ -311,7 +311,14 @@
         if self.copy_list:
             source_file, dest_path, options = self.copy_list.pop()
             self.journal.startFile(source_file)
-            source_fd = open(source_file, 'rb')
+            try:
+                source_fd = open(source_file, 'rb')
+            except:
+                self.journal.copyFailed()
+                self.journal.error("can't open source")
+                self.journal.closeFile()
+                source_fd.close()
+                return True
             filename = os.path.basename(source_file)
             assert(filename)
             dest_file = self.__filename_fix(options.dest_file,options) if options.dest_file else self.__filename_fix(os.path.join(dest_path,filename),options)