Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
8.95k stars 5.16k forks source link

Fix virtual_sdcard handling of unicode characters on Python2 #6539

Closed KevinOConnor closed 2 months ago

KevinOConnor commented 2 months ago

PR #6472 fixed unicode handling on Python3, but broke Python2 support.

This could lead to error messages like UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 12: ordinal not in range(128) on Python2.

Use an alternate fix that should work for both Python3 and Python2.

@zxy16305, @CODeRUS - fyi.

-Kevin

zxy16305 commented 2 months ago

This change looks great. Sorry for only consulting ChatGPT-compatible methods without testing. ><. hh

thijstriemstra commented 2 months ago

Anyone still using Python 2 should have a really really really good reason not to switch to Python 3 (but I really can't think of any reason). A friendly reminder that support for Python 2 ended 4 years ago (01 Jan 2020).