From 2978771ce584aac6d8df91bf3e128085bb790f59 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 1 Oct 2021 19:10:20 -0400 Subject: [PATCH] mcu: Convert to Python3 string encoding Signed-off-by: Kevin O'Connor --- klippy/mcu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/klippy/mcu.py b/klippy/mcu.py index f4d8d5a5..df3b5440 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -657,7 +657,8 @@ class MCU: for i, cmd in enumerate(cmdlist): cmdlist[i] = pin_resolver.update_command(cmd) # Calculate config CRC - config_crc = zlib.crc32('\n'.join(self._config_cmds)) & 0xffffffff + encoded_config = '\n'.join(self._config_cmds).encode() + config_crc = zlib.crc32(encoded_config) & 0xffffffff self.add_config_cmd("finalize_config crc=%d" % (config_crc,)) if prev_crc is not None and config_crc != prev_crc: self._check_restart("CRC mismatch")