Fix str formatting, float given instead of int
[sitarba.git] / sitarba
diff --git a/sitarba b/sitarba
index ecf6f5f0b83adffe607c64a875d850b6ded5bc6d..6f7cf5b69242c641ef61ab22c3d63e2cbe480b34 100755 (executable)
--- a/sitarba
+++ b/sitarba
@@ -513,7 +513,7 @@ class BackupManager:
         # Create new backup directory
         basedir = self.conf.backupdir
         dirname = Backup.getDirName(now, epoch, mode)
-        tmpdirname = dirname + ("-%x" % (random.random()*2e16) )
+        tmpdirname = dirname + ("-%x" % int(random.random()*2e16) )
         targetdir = os.path.join(basedir, tmpdirname)
         os.mkdir(targetdir)
 
@@ -532,6 +532,7 @@ class BackupManager:
             self.backupFileSet(s, targetdir, excludes, since)
 
         logfile.info("Stopped: " + datetime.datetime.now().ctime())
+        fil.close()
 
         # Rename backup directory to final name
         os.rename( targetdir, os.path.join(basedir, dirname) )