Repository navigation
python: reject a bare str or bytes in identify_paths (#1472) - #1476
kaluli123123 wants to merge 7 commits into
Conversation
`str` and `bytes` are registered as `collections.abc.Sequence`, so the container guard in `identify_paths()` let them through. The string was then iterated character by character and the call returned one bogus `MagikaResult` per character instead of raising `TypeError` — including a `Status.OK` `directory` result for the `.` component. Exclude `str`/`bytes` from the guard, which is the only place this can be caught: a bare `str` type-checks fine against `Sequence[Union[str, os.PathLike]]`. Fixes google#1472
|
Thank you! I checked this against the current |
|
Rebased-free update: merged the current
Validation run locally in
After the push, |
|
Synced with latest Local verification in
The fix and its regression test are unchanged by the merge. |
Fixes #1472.
Reject bare
str/bytesinidentify_paths()while preserving path sequences andidentify_path(str). Merged current main (8461733), retaining the upstream native batched pipeline and its documentation.Python 3.13: focused regression and non-slow suite passed (41 passed, 1 skipped); lock, Ruff, formatting, ty, copyright, documentation, KB sync and real API/CLI/module smokes passed.
Current-head workflows need maintainer authorization; formal approval is still required.