diff --git a/src/sagemaker/_studio.py b/src/sagemaker/_studio.py index a23fae87e9..6ea5c4c875 100644 --- a/src/sagemaker/_studio.py +++ b/src/sagemaker/_studio.py @@ -65,7 +65,9 @@ def _find_config(working_dir=None): wd = Path(working_dir) if working_dir else Path.cwd() path = None - while path is None and not wd.match("/"): + + root = Path(wd.anchor) # Properly get the root of the current working directory for both Windows and Unix-like systems + while path is None and wd != root: candidate = wd / STUDIO_PROJECT_CONFIG if Path.exists(candidate): path = candidate