Klipper Error : 'ascii' codec can't decode

I got the Error : Internal error during connect: ‘ascii’ codec can’t decode byte 0xc2 in position 22: ordinal not in range(128)

After updating Klipper/moonraker und raspi

any solutions ?

Please attach the full Klipper log file from the event.

-Kevin

same for me. reflashed host and rpi.klippy.log (9.5 KB)

Internal error during connect: ‘ascii’ codec can’t decode byte 0xc3 in position 27: ordinal not in range(128)

Once the underlying issue is corrected, use the “RESTART”
command to reload the config and restart the host software.
Printer is halted

i hope that helps.

i switched back to b806d71

on 2822680 i got the same error

klippy.log (73.9 KB)

Hi, how do you switch back ?

Putty :

cd ~/klipper
git fetch
git checkout b806d71
sudo service klipper restart

[quote=“Dragi2k, post:6, topic:1049”]
Thankyou, I confirm also that with the b806d71 version Klipper starts without error.

pls change comments with ; to # to fix the issue. the new configparser dont like ; for comments. kevin also commited a fix for it. updating to the new commit should also fix it.

sorry mete you. It did not work.
I just checked ALL my .cfg files and removed all the ; (I had only within the # comments)
re-updated to latest version and get the same error.
switched back and Klipper starts

I just found this

perhaps it can be of any help to you ?

same her i exchanged all ; with ## and … nope, it wont work

I’m not sure why that is occurring. Looks like there is a character in the file that a python package doesn’t like. Can you attach the config file here (it must be attached - don’t copy-and-paste it).

-Kevin

Hopefully this is fixed now (commit 5251bf23). If not, please attach the config file that is not working.

-Kevin

Find invalid characters in your config files like this.
cd into your config file path and execute a grep to find ASCII characters out of given range.

Example:

$ grep --color -P "[\x81-\xff]" *.cfg
[temperature_sensor PI´S_TEMP]
1 Like

Thanks to steadyjaw I could restart Klipper in it’s last version.

The problem comes from the acented characters we use in French.
I made a list of all these characters, changed all to non accented and Klipper suddenly starts !!!

It should be useful to mention in the documentation: DO NOT USE OTHER CHARACTERS THAN ASCII 0…127 IN YOUR CONFIG FILES,

here all I had to correct (just for info)

1 Like

and for koconnor, my printer.cfg file wit 2 acent characters é and à at line 135 (just for example)
this file creates the error.
if changing é to e and à to a, Klipper starts !!

printer.cfg (11.3 KB)

There is a problem
klippy.log (1.5 MB)


printer.cfg (27.8 KB)

It seems there are several issues with the code when there are unicode characters in the config file. I’ve made another change to the handling which I hope improves this (commit c56c34fa). Hopefully this resolves these issues.

-Kevin

Hello Kevin,
I restored all my cfg files with accented characters etc… and Klipper starts.

Thanks for the fix !

Hello Kevin,
Thanks for the fix !