Convert stdin string to bytes regardless of stdin_raw_newlines

This commit is contained in:
Niklas Rousset 2024-08-26 22:28:22 +02:00 committed by Daniel Wozniak
parent eba0b174d7
commit 9da6764eb8
2 changed files with 3 additions and 3 deletions

1
changelog/62501.fixed.md Normal file
View file

@ -0,0 +1 @@
Convert stdin string to bytes regardless of stdin_raw_newlines

View file

@ -33,9 +33,8 @@ class TimedProc:
if not self.stdin_raw_newlines:
# Translate a newline submitted as '\n' on the CLI to an actual
# newline character.
self.stdin = salt.utils.stringutils.to_bytes(
self.stdin.replace("\\n", "\n")
)
self.stdin = self.stdin.replace("\\n", "\n")
self.stdin = salt.utils.stringutils.to_bytes(self.stdin)
kwargs["stdin"] = subprocess.PIPE
if not self.with_communicate: