Please use python native call here: http://docs.python.org/release/2.6.8/library/os.html?highlight=mkdirs#os.makedirs