-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 146-147: invalid continuation byte #126
Comments
It seems your megacli outputs some characters in a non-utf8 charset, that's very weird. |
on another working Server:
|
Good 'ol iso8859 :D I'll send you a patch to try tomorrow |
why is the output iso8859? all locale Settings between the Servers are the same and UTF-8 are default. Can / must i change something? |
We are running a bunch of old PERC 5/i adapters, for which MegaCLI 8.07.14 gives non-UTF8 and non-ASCII output (classified as "data" by the file command). I ended up using the patch below to get megaclisas-status to work with Python 3.9 on bullseye. It replaces diff a/wrapper-scripts/megaclisas-status b/wrapper-scripts/megaclisas-status
--- a/wrapper-scripts/megaclisas-status
+++ b/wrapper-scripts/megaclisas-status
@@ -11,6 +11,7 @@ import sys
import pdb
import inspect
import argparse
+from subprocess import Popen, PIPE, STDOUT
if sys.platform == "win32":
import ctypes
@@ -144,8 +145,10 @@ def getOutput(cmd):
lines = Outputs[cmd]
else:
dbgprint("Not a Cached value: " + str(cmd))
- output = os.popen(cmd)
- for line in output:
+ process = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT, text=True, errors='ignore')
+ process.wait()
+ output = process.stdout.read()
+ for line in output.split("\n"):
if not re.match(r"^$", line.strip()):
lines.append(line.strip())
Outputs[cmd] = lines |
I found a bug in megaclisas-status. After some debugging i found the issue.
OS: Debian Bullseye
APPS:
Bug:
after some debugging the problem is the Name ob the Virtual Drive. megaclisas-status execute the following:
if i change all megacli commands with "xxxx | grep -v Name", megaclisas-status is working.
I dont know why my VD Name is "Virtual Disk ??" also i dont know to change this.
Regards
Sebastian
The text was updated successfully, but these errors were encountered: