Switch to os.makedirs to get ensure all intermediate directories are made