From cf76e7d1740de78b55403c1ceef061c1cd30b42e Mon Sep 17 00:00:00 2001 From: Player <84974825+player23-0@users.noreply.github.com> Date: Fri, 31 May 2024 04:58:32 -0400 Subject: [PATCH 1/2] NVRAM dump - Fix Fixes the error when trying to dump nvram with: nvram dump --- helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper.py b/helper.py index 55244a0..c9e0fe4 100644 --- a/helper.py +++ b/helper.py @@ -404,6 +404,9 @@ def write(self, path, data, m='wb'): # append to local file def append(self, path, data): + # Ensure data is in bytes format + if isinstance(data, str): + data = data.encode('utf-8') self.write(path, data, 'ab+') # ---------------------------------------------------------------------- From 413a90862e020b85f789ab6266312ebd438a1085 Mon Sep 17 00:00:00 2001 From: Player <84974825+player23-0@users.noreply.github.com> Date: Fri, 31 May 2024 04:59:41 -0400 Subject: [PATCH 2/2] NVRAM dump - Fix Fix line 741 - part of the nvram dump fix --- pjl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pjl.py b/pjl.py index e644d37..4426894 100644 --- a/pjl.py +++ b/pjl.py @@ -738,7 +738,7 @@ def do_nvram(self, arg): commands = ["@PJL RNVRAM ADDRESS=" + str(n) for n in memspace] self.chitchat("Writing copy to " + lpath) if os.path.isfile(lpath): - file().write(lpath, "") # empty file + file().write(lpath, b"") # empty file for chunk in list(chunks(commands, steps)): str_recv = self.cmd(c.EOL.join(chunk)) if not str_recv: