Create the output folder if it doesn't pre-exist.
authorSteven Black <redacted>
Sun, 13 Mar 2016 04:44:23 +0000 (23:44 -0500)
committerSteven Black <redacted>
Sun, 13 Mar 2016 04:44:23 +0000 (23:44 -0500)
updateHostsFile.py

index 903966ce94410bc19d29a2e303f1631277d4b566..32dcb596946a4d2e08500ab15bc8b6bbf2d573b1 100644 (file)
@@ -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()
git clone https://git.99rst.org/PROJECT