From: Jeremy Stanley Date: Mon, 29 Dec 2014 20:21:49 +0000 (+0000) Subject: Fix type mismatches in save file rotation X-Git-Tag: 0.0.1~223 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=a4a7fabfdfe68676346e9f9d44daf1c91b23ab96;p=mudpy.git Fix type mismatches in save file rotation The numeric suffix on rotated save files needs to be treated as an int during rotation calculations but as a str during filename generation. Make it so. --- diff --git a/lib/mudpy/data.py b/lib/mudpy/data.py index b7d173b..3eddc43 100644 --- a/lib/mudpy/data.py +++ b/lib/mudpy/data.py @@ -133,13 +133,13 @@ class DataFile: backups.reverse() for old_backup in backups: if old_backup >= max_count - 1: - os.remove(self.filename + "." + old_backup) + os.remove(self.filename + "." + str(old_backup)) elif not os.path.exists( - self.filename + "." + old_backup + 1 + self.filename + "." + str(old_backup + 1) ): os.rename( - self.filename + "." + old_backup, - self.filename + "." + old_backup + 1 + self.filename + "." + str(old_backup), + self.filename + "." + str(old_backup + 1) ) if not os.path.exists(self.filename + ".0"): os.rename(self.filename, self.filename + ".0")