Klipper crashes when Exclude_Object_Define contains non-ascii characters

Hi,

A user on the Voron Discord came across an issue where Mainsail would show the print as paused, but upon attempting to resume, the console would print “Print is not paused, resume aborted.” This only occurred when they attempted to print certain gcode files. After further testing, we determined the issue was due to an " ł " character in an object name that was being passed in from the slicer in an EXCLUDE_OBJECT_DEFINE line.

I am able to reliably reproduce the issue by sending the following two gcode commands in the console:

EXCLUDE_OBJECT_DEFINE NAME=Siatka_bryłowa1_stl_id_1_copy_0 CENTER=170.112,171.800 POLYGON=[[155.702,157.011],[155.702,186.587],[185.277,186.587],[185.277,157.011]]
EXCLUDE_OBJECT_DEFINE

Klipper appears to accept the definition but crashes on any further attempts to run EXCLUDE_OBJECT_DEFINE commands.

I have attached a Klippy.log from my reproduction of the issue.
klippy (64).log (1.5 MB)

It is a know issue and will also affect gcode filenames etc. See Internal error on command:"SDCARD_PRINT_FILE" · Issue #4794 · Klipper3d/klipper · GitHub

Got it, thanks.

I upgraded my Klipper install to Python3 as one of the replies mentioned and I can no longer reproduce the issue.