mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 02:33:09 +00:00
Fix encoding of code-smell paths on stdin.
This commit is contained in:
@@ -327,7 +327,7 @@ def raw_command(cmd, capture=False, env=None, data=None, cwd=None, explain=False
|
||||
|
||||
if communicate:
|
||||
encoding = 'utf-8'
|
||||
data_bytes = data.encode(encoding) if data else None
|
||||
data_bytes = data.encode(encoding, 'surrogateescape') if data else None
|
||||
stdout_bytes, stderr_bytes = process.communicate(data_bytes)
|
||||
stdout_text = stdout_bytes.decode(encoding, str_errors) if stdout_bytes else u''
|
||||
stderr_text = stderr_bytes.decode(encoding, str_errors) if stderr_bytes else u''
|
||||
|
||||
Reference in New Issue
Block a user