Might want to try using `os.path.abspath` for the directory.