lib.util.copy(): Require recursive for directories #169

Merged
Jan Lindemann merged 1 commit from jan/feature/20261107-lib-util-copy-require-recursive-for-directories into master 2026-11-07 14:35:41 +01:00 AGit
Owner

lib.util.copy(): Require recursive for directories

copy() handed a non-recursive copy of a directory to the single-object get() path. For a plain context the backend then fails with a transport error, and for a kvfile store the store root is a branch, not an entry, so the get() fails with a FileNotFoundError naming a transformed address: copying kvfile:///etc reported FileNotFoundError: etc.

Require recursive for a directory source that is not fetchable as a whole, as cp requires -r for directories: copy() now raises with a message naming the source and the recursive option, instead of falling through to get().

Add a unit test that covers a directory source for a plain context and a kvfile store.

#### lib.util.copy(): Require recursive for directories `copy()` handed a non-recursive copy of a directory to the single-object `get()` path. For a plain context the backend then fails with a transport error, and for a kvfile store the store root is a branch, not an entry, so the `get()` fails with a FileNotFoundError naming a transformed address: copying `kvfile:///etc` reported `FileNotFoundError: etc`. Require recursive for a directory source that is not fetchable as a whole, as cp requires -r for directories: `copy()` now raises with a message naming the source and the recursive option, instead of falling through to `get()`. Add a unit test that covers a directory source for a plain context and a kvfile store.
lib.util.copy(): Require recursive for directories
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m51s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m0s
CI / Packaging test (pull_request) Successful in 0s
e9a93ece35
copy() handed a non-recursive copy of a directory to the single-object
get() path. For a plain context the backend then fails with a transport
error, and for a kvfile store the store root is a branch, not an entry,
so the get() fails with a FileNotFoundError naming a transformed address:
copying "kvfile:///etc" reported "FileNotFoundError: etc".

Require recursive for a directory source that is not fetchable as a whole,
as cp requires -r for directories: copy() now raises with a message naming
the source and the recursive option, instead of falling through to get().

Add a unit test that covers a directory source for a plain context and a
kvfile store.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-11-07 14:16:13 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!169
No description provided.