Files
dxdesigner-part-replacement/tools/acceptance_workspace.py

15 lines
533 B
Python

"""Disposable acceptance roots that preserve the application's inherited ACL.
Python's Windows tempfile.mkdtemp uses mode 0700; its OWNER RIGHTS-only read
grant does not authorize the official Harness restricted shell token.
"""
from pathlib import Path
from uuid import uuid4
def create_workspace_root(parent: Path, prefix: str) -> Path:
parent.mkdir(parents=True, exist_ok=True)
root = parent / (prefix + uuid4().hex)
root.mkdir() # Default inherited ACL, not tempfile's private 0700 ACL.
return root.resolve()