cmds.posix.copy: Allow missing mode option #134
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/fix/20261003-cmds-posix-copy-allow-missing-mode-option"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 basebefore the copy even started. Convert the mode only when it is given, and pass None otherwise, which
copy()already treats asno mode change.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