From d67a7bc3be2c31e3b4870b7d236cb868e7939aec Mon Sep 17 00:00:00 2001 From: Steven Black Date: Sat, 12 Mar 2016 23:44:23 -0500 Subject: [PATCH] Create the output folder if it doesn't pre-exist. --- updateHostsFile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()