Issue #91: fix - make the date and time windows filesystem-compatible.

This commit is contained in:
Steven Black
2016-02-21 20:55:38 -05:00
parent d76b355b77
commit 223b9409da
+1 -1
View File
@@ -370,7 +370,7 @@ def moveHostsFileIntoPlace(finalFile):
def removeOldHostsFile(): # hotfix since merging with an already existing hosts file leads to artefacts and duplicates
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")))
backupFilePath = os.path.join(BASEDIR_PATH, 'hosts-{0}'.format(time.strftime("%Y-%m-%d-%H-%M-%S")))
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