AngelosZou/dsh-python-tempfile-shim
AngelosZou★ 0JavaScriptLast synced: 2026-08-16
—
README excerpt
dsh-python-tempfile-shim 简体中文 Temporary plugin that works around one Windows sandbox incompatibility until DeepSeek Harness ships an upstream fix. It is not published to npm; install it from a local clone. Read SECURITY.md before installing. The plugin lets Python (including pytest) use temporary directories inside the DSH Windows sandbox. Background: CPython on Windows builds a directory DACL from os.mkdir 's mode argument; 0o700 produces an owner-only directory. tempfile.mkdtemp and pytest's basetemp chain both use 0o700 . The DSH Windows sandbox runs commands under a WRITE RESTRICTED token whose restricting-SID list excludes the user's own SID, so the confined process cannot read or write the directories it just created. pytest tmp path / tmpdir tests fail with [Errno 13] / WinError 5 and the [sandbox: file access denied under workspace-write mode] marker. Scope - All 0o700 directory creation routes through os.mkdir : tempfile.mkdtemp , tempfile.TemporaryDirectory , os.makedirs(mode=0o700) , pathlib.Path.mkdir(mode=0o700) , pytest, tox/nox (the shim propagates to subprocesses via PYTHONPATH ). - Windows only; on other platforms apply() registers nothing. - File creation ( os.ope…
View full README on GitHub →