Skip to content

[Bug] [setValue] if "\n" in variable, then setValue function will work bad #15136

@kevinkelin

Description

@kevinkelin

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

In python task , if a variable has "\n", then use setValue to make a Parameter for next node, the variable will not work well

node_one

s = "hello \n world"
print("${setValue(message=%s)}"%s)

node_two

echo "${message}"

echo "hi"

check runtime log

node_one

[INFO] 2023-11-08 10:51:02.588 +0800 - process start, process id is: 10376
[INFO] 2023-11-08 10:51:03.588 +0800 -  -> 
	 world)}
[INFO] 2023-11-08 10:51:03.590 +0800 - process has exited. execute 

node_two

[INFO] 2023-11-08 10:51:04.374 +0800 - process start, process id is: 30190
[INFO] 2023-11-08 10:51:05.374 +0800 -  -> 
	
	hi
[INFO] 2023-11-08 10:51:05.375 +0800 - process has exited. execute

What you expected to happen

In node_two, when echo "${message}" will show the Parameter set in pre task, in this case, want show “hello \n world"

How to reproduce

create a workflow, the first task use python task, make a variable include "\n", then use setValue to make a Parameter

Anything else

No response

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

documentimprovementmake more easy to user or prompt friendly

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions