From 183111be6505ba0a702db448b05a1a5fd0538c9c 2011-07-04 22:44:51 From: Thomas Kluyver Date: 2011-07-04 22:44:51 Subject: [PATCH] When moving old config files, don't clobber files we've previously moved. --- diff --git a/IPython/utils/path.py b/IPython/utils/path.py index 3c8ee4e..f715a14 100644 --- a/IPython/utils/path.py +++ b/IPython/utils/path.py @@ -435,6 +435,10 @@ def check_for_old_config(ipython_dir=None): os.unlink(f) else: oldf = f+'.old' + i = 0 + while os.path.exists(oldf): + oldf = f+'.old.%i'%i + i += 1 os.rename(f, oldf) warn.warn("Renamed old IPython config file '%s' to '%s'." % (f, oldf)) warned = True