diff --git a/updateHostsFile.py b/updateHostsFile.py index 903966ce9..32dcb5969 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -288,7 +288,7 @@ def removeDupsAndExcl(mergeFile): os.makedirs(outputPath) # Another mode is required to read and write the file in Python 3 - finalFile = open(os.path.join(outputPath, 'hosts'), 'r+b') + finalFile = open(os.path.join(outputPath, 'hosts'), 'w+') mergeFile.seek(0) # reset file pointer hostnames = set()