See the following two methods for obtaining the file's path: os.path.realpath(file) or os.path.abspath(os.path.expanduser(file)) Which is more robust?