# HG changeset patch # User Goffi # Date 1285836292 -28800 # Node ID 95f16ff363086578db87e02243a0b87ae22097ee # Parent d0c00ef2b9175eeb1692d4c78f471fbae2f4d0d0 fixed bad closure when a file already exists diff -r d0c00ef2b917 -r 95f16ff36308 gcp --- a/gcp Thu Sep 30 16:27:28 2010 +0800 +++ b/gcp Thu Sep 30 16:44:52 2010 +0800 @@ -308,6 +308,10 @@ dest_file = self.__filename_fix(os.path.join(dest_path,filename),options) if os.path.exists(dest_file) and not options.force: warning (_("File [%s] already exists, skipping it !") % dest_file.decode('utf-8','replace')) + self.journal.copyFailed() + self.journal.error("already exists") + self.journal.closeFile() + source_fd.close() return True try: dest_fd = open(dest_file, 'wb') @@ -321,7 +325,7 @@ gobject.io_add_watch(source_fd,gobject.IO_IN,self._copyFile, (dest_fd, options), priority=gobject.PRIORITY_DEFAULT) if not self.progress: - info(_("COPYING %(source)s ==> %(dest)s") % {"source":source_path.decode('utf-8','replace'), + info(_("COPYING %(source)s ==> %(dest)s") % {"source":source_file.decode('utf-8','replace'), "dest":dest_file.decode('utf-8','replace')}) return True else: