Is mk_dir not shadowing os.mkdir ?