lib.FileContext.put(): Change param mode type str -> int

Don't pass mode as a string to put(). Given the multitunde of possible string representations for numbers, some understood by int(string, 0) and some not, there's too much room for passing strings which are unparseable, or worse, prone to be parsed wrongly.

However, pass mode down to _put() as a string for convenience, because that's what most _put() implementations will need to use. If they don't, converting to int is easy from the one defined string format.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-17 15:05:42 +02:00
commit fe3508036e
3 changed files with 5 additions and 4 deletions

View file

@ -31,4 +31,4 @@ class CmdCopy(Cmd): # export
return url
return self.app.distro_info(url)
await copy(__expand(args.src), __expand(args.dst),
owner=args.owner, group=args.group, mode=args.mode)
owner=args.owner, group=args.group, mode=int(args.mode, 0))