Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py13
1 files changed, 9 insertions, 4 deletions
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]: