From 3df4c89e013c26f50cf60fbae98d84cbc4ff76db Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 30 Sep 2010 16:44:52 +0800 Subject: [PATCH] fixed bad closure when a file already exists --- gcp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcp b/gcp index 3b73218..11e2a98 100755 --- a/gcp +++ b/gcp @@ -308,6 +308,10 @@ class GCP(): 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 @@ class GCP(): 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: