# Python3 Function Error

**URL:** <https://discourse.nodered.org/t/python3-function-error/40853>\
**Category:** General\
**Created:** [12 February 2021 06:59 UTC](https://discourse.nodered.org/t/python3-function-error/40853 "2021-02-12T06:59:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kajal](https://avatars.discourse-cdn.com/v4/letter/k/7993a0/32.png) [@kajal](https://discourse.nodered.org/u/kajal)\
**Post date:** [12 February 2021 06:59 UTC](https://discourse.nodered.org/t/python3-function-error/40853/1 "2021-02-12T06:59:22Z")

</div>

I am using Python3 function and facing this following errors,

1. File "C:\Python39\lib\json\__init_\_.py", line 341, in loads.
2. s = s.decode(detect\_encoding(s), 'surrogatepass') File "C:\Python39\lib\encodings\utf\_32\_le.py", line 11, in decode.
3. 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)

Please Help.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2021 08:59 UTC](https://discourse.nodered.org/t/python3-function-error/40853/2 "2021-02-12T08:59:53Z")

</div>

What do you mean by using Python3 function?

Are you using a python node (which one) or calling python in an exec node, or what?

---

<div class="post-metadata">

**Author:** ![kajal](https://avatars.discourse-cdn.com/v4/letter/k/7993a0/32.png) [@kajal](https://discourse.nodered.org/u/kajal)\
**Post date:** [12 February 2021 09:01 UTC](https://discourse.nodered.org/t/python3-function-error/40853/3 "2021-02-12T09:01:58Z")

</div>

python3 function node.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2021 09:17 UTC](https://discourse.nodered.org/t/python3-function-error/40853/4 "2021-02-12T09:17:13Z")

</div>

I presume you mean node-red-contrib-python3-function.  
If you look at its page in the flows site you will see it has not been updated in 4 years, and there are unaddressed issues on its github page.  
There have been issues with both python nodes and many have switched to calling the python script in an exec node instead, or for long running scripts using the daemon node, or running the script completely outside node-red and communicating with it via MQTT or other method.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 April 2021 09:18 UTC](https://discourse.nodered.org/t/python3-function-error/40853/5 "2021-04-13T09:18:02Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
