lib.ExecContext._stat(): Don't decode stderr twice

The output of /usr/bin/stat is decoded once the Result object is decoded as a whole, and then again individually, which fails of course. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-27 20:56:39 +02:00
commit 6ced64202e
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -563,7 +563,7 @@ class ExecContext(Base):
if result.status == 0: if result.status == 0:
return _build_stat_result(result.stdout.split(_US), mode_base=16) return _build_stat_result(result.stdout.split(_US), mode_base=16)
if not _looks_like_option_error(result.stderr.decode()): if not _looks_like_option_error(result.stderr):
# log(DEBUG, f'GNU stat attempt failed on "{path}" ({str(e)})') # log(DEBUG, f'GNU stat attempt failed on "{path}" ({str(e)})')
_raise_stat_error(path, result.stderr, result.status) _raise_stat_error(path, result.stderr, result.status)