fix deadlock on lost windows drive (closes #971);

it would spin on '\\\\?\\g:\\'
This commit is contained in:
ed 2025-12-01 19:23:01 +00:00
parent a9378a8e9c
commit 945b2276a0

View file

@ -40,7 +40,7 @@ def makedirs(name: str, vf: dict[str, Any] = MKD_755, exist_ok: bool = True) ->
todo = []
bname = fsenc(name)
while bname:
if os.path.isdir(bname):
if os.path.isdir(bname) or bname in todo:
break
todo.append(bname)
bname = os.path.dirname(bname)