Whole file

arsenetar/send2trash

The author described this change as fix: Correct is_parent() path handling. It counts as a record because the check below fails on the code as it stood at ad0f2af98 and passes on 522bafebc, with nothing else changed between the two runs.

Fix saved2026-06-16
Sharing licenceBSD-3-Clause · LICENSE
Change size+3 0

What the code was meant to do, written into the code itself as a save note

fix: Correct is_parent() path handling

The change

4646 parent = op.realpath(parent)
4747 if isinstance(parent, str):
4848 parent = os.fsencode(parent)
49+ # Ensure parent ends with a separator to prevent invalid substring matches
50+ if not parent.endswith(b"/"):
51+ parent += b"/"
4952 return path.startswith(parent)
5053
5154

The check that tells the two apart

failpass·tests/test_plat_other.py::test_is_parent_substring_path_bug_e2e

Check file tests/test_plat_other.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itad0f2af98418a5a577c05b8486949a1c05bf19e2
Broken version dated2026-01-27
Modulesend2trash.plat_other
Units changedis_parent
Fingerprint0f915e8aab1a6ae8
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.