# Exec Node /n issue in spawn mode

**URL:** <https://discourse.nodered.org/t/exec-node-n-issue-in-spawn-mode/61158>\
**Category:** General\
**Created:** [12 April 2022 09:16 UTC](https://discourse.nodered.org/t/exec-node-n-issue-in-spawn-mode/61158 "2022-04-12T09:16:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VicBos](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@VicBos](https://discourse.nodered.org/u/VicBos)\
**Post date:** [12 April 2022 09:16 UTC](https://discourse.nodered.org/t/exec-node-n-issue-in-spawn-mode/61158/1 "2022-04-12T09:16:03Z")

</div>

Hi.

I'm using the Exec node to run python scripts.  
When the spawn mode is selected (-u python command to disable buffering is included) I randomly get msg.payload that isn't terminated with /n.  
The missing /n will then appear in a new msg.payload that only contains /n.

 ![BMS Node Red Exec Node Spawn New Line Issue ADS](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/3/238670c1f9ae9668aeda40c6b819c25c6abdd0fa.png)

Image:

1. (A) a normal msg.payload with the /n nicely intact.
2. (B) the payload without /n.
3. (C) the /n in its very own payload.

I'm certain this doesn't somehow originate from the python script since I've done some thorough testing and the output doesn't contain /n..

Off course I can filter / ignore this but I'm curious to know if its a known issue.

Regards

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2022 09:21 UTC](https://discourse.nodered.org/t/exec-node-n-issue-in-spawn-mode/61158/2 "2022-04-12T09:21:14Z")

</div>

Perhaps it's python buffering the output.

You could try python -u scriptname as the command to disable buffering.

---

<div class="post-metadata">

**Author:** ![VicBos](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@VicBos](https://discourse.nodered.org/u/VicBos)\
**Post date:** [12 April 2022 09:23 UTC](https://discourse.nodered.org/t/exec-node-n-issue-in-spawn-mode/61158/3 "2022-04-12T09:23:27Z")

</div>

Should have mentioned, -u command is included.

---

<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:** [11 June 2022 09:24 UTC](https://discourse.nodered.org/t/exec-node-n-issue-in-spawn-mode/61158/4 "2022-06-11T09:24:05Z")

</div>

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