file.py: in mkdirp, raise error when arg is a file