From b0da2ab643070a867fdb57442b4d65c961938dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 1 May 2023 16:50:34 +0200 Subject: [PATCH] BUG: fix confusing error message when yt fails to locate data --- yt/sample_data/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt/sample_data/api.py b/yt/sample_data/api.py index 8819c826b29..af1121d4b4d 100644 --- a/yt/sample_data/api.py +++ b/yt/sample_data/api.py @@ -172,7 +172,7 @@ def lookup_on_disk_data(fn) -> Path: FileNotFoundError """ - path = Path(fn).expanduser() + path = Path(fn).expanduser().resolve() if path.exists(): return path @@ -182,7 +182,7 @@ def lookup_on_disk_data(fn) -> Path: if not test_data_dir.is_dir(): raise FileNotFoundError(err_msg) - alt_path = _get_test_data_dir_path() / fn + alt_path = _get_test_data_dir_path().joinpath(fn).resolve() if alt_path != path: if alt_path.exists(): return alt_path