Problem decoding python3-function node - 'utf-32-le' codec can't decode bytes in position 16-19: code point not in range(0x110000)

Hello,

I have a problem with executing a task using Python3-function in Node-RED. When using the simplest default Python node, I encounter errors like this:

File "C:\Program Files (x86)\Python39-32\lib\json\__init__.py", line 341, in loads*

s = s.decode(detect_encoding(s), 'surrogatepass')*** File "C:\Program Files (x86)\Python39-32\lib\encodings\utf_32_le.py", line 11, in decode***
return codecs.utf_32_le_decode(input, errors, True)***
UnicodeDecodeError: 'utf-32-le' codec can't decode bytes in position 16-19: code point not in range(0x110000)

It seems that the Python node cannot use UTF-32-LE, but I have tried converting texts to UTF-8, UTF-16, and even with an empty node that only returns return 0, the same error occurs.

I have already tried installing different versions of Python (3.9, 3.10, 3.12) hoping it's a compatibility issue between the node and Python version, but the same error occurs every time. I have also installed it on two different computers, but the result is exactly the same...

Programs in PyCharm and other Python IDEs work correctly. I checked locale.getpreferredencoding() to see the preferred encoding in my IDE, and I got cp1250.

Python3 - 3.9, 3.10, 3.12
Node-Red- V3.1.7
NodeJS -V20.11.1

I'm out of ideas on what might be causing the problem. Can you help?

Welcome to the forum @postek1313

Many have problems with the python nodes. The best solution is to convert the python source to JavaScript, or, if that cannot be done, to call a python script using an exec node.