mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Fixes to the controller text model (#17527)
* Fixes to the controller text model * Change command line args to text type * Make display replace undecodable bytes with replacement chars. This is only a problem on pyhton3 where surrogates can enter into the msg but sys.stdout doesn't know how to handle them. * Remove a deprecated playbook syntax in unicode.yml * Fix up run_cmd to change its parameters to byte string at appropriate times.
This commit is contained in:
parent
9868117d1f
commit
bf29961947
4 changed files with 27 additions and 9 deletions
|
@ -124,7 +124,7 @@ class Display:
|
|||
# Convert back to text string on python3
|
||||
# We first convert to a byte string so that we get rid of
|
||||
# characters that are invalid in the user's locale
|
||||
msg2 = to_text(msg2, self._output_encoding(stderr=stderr))
|
||||
msg2 = to_text(msg2, self._output_encoding(stderr=stderr), errors='replace')
|
||||
|
||||
if not stderr:
|
||||
fileobj = sys.stdout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue