cbook.mkdirs() is even safer than os.makedirs().  Imagine two processes, one needing to make A/B, and the other needing to make A/C.  There is a race condition in os.makedirs() where one of the two processes will fail to make their directory because the exception was thrown while dealing with the parent directory.