os.makedirs(os.path.dirname(filename)) will fail if filename doesn't have a directory component. We can go through all such cases in the code and replace with something like makedirs(dirname(abspath("b/c/a")) (all from os.path). Or perhaps the path module provides a shorter way to do this..
os.makedirs(os.path.dirname(filename))
will fail iffilename
doesn't have a directory component. We can go through all such cases in the code and replace with something likemakedirs(dirname(abspath("b/c/a"))
(all fromos.path
). Or perhaps thepath
module provides a shorter way to do this..