Both os.path.exists() and pathlib.Path().is_file() will resolve symbolic links and handle relative paths, so they can be used with confidence in such scenarios.