Skip to content

Commit 375f385

Browse files
vladimir-avinkinm4ce
authored andcommitted
Added decode errors handling to execute method (#16)
1 parent d64e14c commit 375f385

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

megacli/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def execute(self, cmd):
3838
proc = subprocess.Popen("{0} {1} -NoLog".format(self.cli_path, cmd), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
3939
out, err = proc.communicate()
4040
if isinstance(out, bytes):
41-
out = out.decode()
41+
out = out.decode(errors="ignore")
4242
if isinstance(err, bytes):
43-
err = err.decode()
43+
err = err.decode(errors="ignore")
4444

4545
if proc.returncode:
4646
ex = MegaCLIError(err.rstrip())

0 commit comments

Comments
 (0)