Describe the bug
trestle.common.trash.to_origin_dir_path() incorrectly truncates valid directory names that contain __bk.
The function currently splits each trash path segment on __bk and keeps only the first segment.
Because of that, a real directory name like alpha__bkbeta is recovered as alpha, which is wrong.
This is distinct from dotted-path issues (#2208 / #2187). It affects names containing the trash directory marker token itself.
To Reproduce
- Create a temporary trestle workspace with
.trestle/.
- Create a directory named
catalogs/alpha__bkbeta.
- Compute its trash directory path with:
trash.to_trash_dir_path(original_path)
- Create that trash path so reverse conversion can run.
- Convert back with:
trash.to_origin_dir_path(trash_path)
- Compare recovered path with original path.
Expected behavior
Recovered path should exactly match the original:
.../catalogs/alpha__bkbeta
Actual behavior
Recovered path is truncated:
.../catalogs/alpha
Verified reproduction output
trash path: /tmp/.../ws/.trestle/_trash/catalogs/alpha__bkbeta__bk
recovered origin: /tmp/.../ws/catalogs/alpha
matches original: False
Environment
- OS: Linux
- Python: 3.10.12
- Repo state: current
develop-based local checkout
- Package context: local venv with compliance-trestle
Describe the bug
trestle.common.trash.to_origin_dir_path()incorrectly truncates valid directory names that contain__bk.The function currently splits each trash path segment on
__bkand keeps only the first segment.Because of that, a real directory name like
alpha__bkbetais recovered asalpha, which is wrong.This is distinct from dotted-path issues (#2208 / #2187). It affects names containing the trash directory marker token itself.
To Reproduce
.trestle/.catalogs/alpha__bkbeta.trash.to_trash_dir_path(original_path)trash.to_origin_dir_path(trash_path)Expected behavior
Recovered path should exactly match the original:
.../catalogs/alpha__bkbetaActual behavior
Recovered path is truncated:
.../catalogs/alphaVerified reproduction output
Environment
develop-based local checkout