From: Steven Black Date: Sun, 21 Feb 2016 16:37:03 +0000 (-0500) Subject: Issue #91: fix - hoping this works better under windows. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=e8033bff7281ab34d458290cf7b62584d2fc0ed0;p=stevenblack-hosts.git Issue #91: fix - hoping this works better under windows. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 25747bb0b..d397f67d6 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -371,7 +371,7 @@ def removeOldHostsFile(): # hotfix since merging with an already e oldFilePath = os.path.join(BASEDIR_PATH, 'hosts') open(oldFilePath, 'a').close() # create if already removed, so remove wont raise an error backupFilePath = os.path.join(BASEDIR_PATH, 'hosts-{0}'.format(time.strftime("%c"))) - shutil.copyfile(oldFilePath, backupFilePath) # make a backup copy, marking the date in which the list was updated + shutil.copy(oldFilePath, backupFilePath) # make a backup copy, marking the date in which the list was updated os.remove(oldFilePath) open(oldFilePath, 'a').close() # create new empty hostsfile