From: Steven Black Date: Sun, 13 Mar 2016 04:44:23 +0000 (-0500) Subject: Create the output folder if it doesn't pre-exist. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d67a7bc3be2c31e3b4870b7d236cb868e7939aec;p=stevenblack-hosts.git Create the output folder if it doesn't pre-exist. --- 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()