Skip to content

Commit e64d2c9

Browse files
committed
fix: resolve Windows path handling in _find_config
* Replace Path.match("/") with Path.anchor comparison * Fix infinite loop in _studio.py path traversal
1 parent 342fbbc commit e64d2c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sagemaker/_studio.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def _find_config(working_dir=None):
6565
wd = Path(working_dir) if working_dir else Path.cwd()
6666

6767
path = None
68-
while path is None and not wd.match("/"):
68+
69+
root = Path(wd.anchor) # Properly get the root of the current working directory for both Windows and Unix-like systems
70+
while path is None and wd != root:
6971
candidate = wd / STUDIO_PROJECT_CONFIG
7072
if Path.exists(candidate):
7173
path = candidate

0 commit comments

Comments
 (0)