Issues / #3501

#3501 [Other] in_trash misses Windows Recycle Bin paths on Linux (Path does not split backslashes)

open · @TheHubUser4860938 · 0 コメント · GitHub で見る

Setup & installServer & APIAMD / HIPWindowsLinux

本文

Problem: the `in_trash()` helper added for #3410 (`strata_control/discovery.py`) never matches a Windows Recycle Bin path when it runs on Linux: `Path(path).parts` treats a backslash as an ordinary character on POSIX, so the whole path arrives as ONE part and `$RECYCLE.BIN` is never seen. Upstream's own #3410 test fails on Linux for exactly this reason.

Expected: the function's docstring names `$RECYCLE.BIN\..` and `test_issues_022.py` asserts a Windows Recycle Bin path on every OS the suite runs on; both should hold on Linux.

Actual (reproduced locally, clean `v0.2.1.3`, Linux, Python 3.14):
```
git checkout v0.2.1.3
python -m pytest "tests/terminal/test_issues_022.py::Issue3410TrashIsNotAnInstall::test_trash_folders_are_recognised" -q
> AssertionError: False is not true : C:\$Recycle.Bin\S-1-5-21\$R123\Strata
```
or directly: `python -c "from strata_control.discovery import in_trash; print(in_trash(r'C:\$Recycle.Bin\S-1-5-21\x\Strata'))"` prints `False` on Linux, `True` on Windows.

Scope of the user-visible effect, stated honestly: on Linux, paths read live from a mounted NTFS drive arrive POSIX-style (`/mnt/d/$RECYCLE.BIN/...`) and DO match today; the gap is Windows-shaped path strings on Linux - the case the docstring and the test name (and a Linux install reading a settings file written by its Windows twin would produce).

CI note: the repository's workflows run only `tests/terminal/test_runtime.py` (terminal-minimal-server) plus the monitor jobs, so `test_issues_022.py` is not exercised on Linux in CI - which is why this shipped.

Suggested fix (one line; a no-op on Windows, where Path already split the backslashes):
```python
parts = [x.lower() for p in Path(path).parts for x in p.split("\\")]
```
With exactly this line, `tests/terminal/test_issues_022.py` passes in full on Linux (26 passed). Our fork merge carried the fix already; posting so upstream can take it.

Reproduction status: reproduced locally (test failure on the clean tag).
Environment: v0.2.1.3 (cbfd5b92), Linux, Python 3.14; no GPU involved - Terminal/discovery code only.

関連リンク

インストール・モデル・リリースへのサイト内リンク。