cmds.posix.copy: Allow missing mode option #134

Merged
Jan Lindemann merged 1 commit from jan/fix/20261003-cmds-posix-copy-allow-missing-mode-option into master 2026-10-03 10:33:20 +02:00 AGit
Owner

cmds.posix.copy: Allow missing mode option

The -m option of posix copy is optional, and its argparse default is None, but _run() converts it unconditionally and crashes:

mode = int(args.mode, 0)

so every copy without -m died with

TypeError: int() can't convert non-string with explicit base

before the copy even started. Convert the mode only when it is given, and pass None otherwise, which copy() already treats as no mode change.

#### cmds.posix.copy: Allow missing mode option The -m option of posix copy is optional, and its argparse default is None, but `_run()` converts it unconditionally and crashes: mode = `int(args.mode, 0)` so every copy without -m died with TypeError: `int()` can't convert non-string with explicit base before the copy even started. Convert the mode only when it is given, and pass None otherwise, which `copy()` already treats as `no mode change`.
cmds.posix.copy: Allow missing mode option
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m11s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m45s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m55s
CI / Packaging test (push) Successful in 0s
9eec04f0f3
The -m option of posix copy is optional, and its argparse default is None,
but _run() converts it unconditionally and crashes:

    mode = int(args.mode, 0)

so every copy without -m died with

    TypeError: int() can't convert non-string with explicit base

before the copy even started. Convert the mode only when it is given, and
pass None otherwise, which copy() already treats as "no mode change".

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.99.2
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-10-03 10:20:00 +02: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!134
No description provided.