index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Daniel Girtler <blackrabbit256@gmail.com> | 2023-10-02 21:01:23 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 21:01:23 +1100 |
commit | 5c903df55fac449baae1e9cc23b04f6beeb55364 (patch) | |
tree | e9715ce5f82b57a34d9b0726973187730bca8cb0 /archinstall/lib/general.py | |
parent | a095e393d8517e99f8832c447fd2ef0902cb6ca6 (diff) |
-rw-r--r-- | archinstall/lib/general.py | 13 |
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 71981fb6..3697cf2d 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -430,10 +430,15 @@ class SysCommand: return True - def decode(self, *args, **kwargs) -> Optional[str]: - if self.session: - return self.session._trace_log.decode(*args, **kwargs) - return None + def decode(self, encoding: str = 'utf-8', errors='backslashreplace', strip: bool = True) -> str: + if not self.session: + raise ValueError('No session available to decode') + + val = self.session._trace_log.decode(encoding, errors=errors) + + if strip: + return val.strip() + return val @property def exit_code(self) -> Optional[int]: |