diff --git a/changelogs/fragments/psrp-utf8.yaml b/changelogs/fragments/psrp-utf8.yaml new file mode 100644 index 00000000000..cf04763a121 --- /dev/null +++ b/changelogs/fragments/psrp-utf8.yaml @@ -0,0 +1,2 @@ +bugfixes: +- psrp - Fix issue when dealing with unicode values in the output for Python 2 - https://github.com/ansible/ansible/pull/46998 diff --git a/lib/ansible/plugins/connection/psrp.py b/lib/ansible/plugins/connection/psrp.py index ff8c5de324b..4a5b53e07fe 100644 --- a/lib/ansible/plugins/connection/psrp.py +++ b/lib/ansible/plugins/connection/psrp.py @@ -557,7 +557,7 @@ if ($bytes_read -gt 0) { # create our own output based on the properties if that is the # case+ try: - output_msg = str(output) + output_msg = to_text(output) except TypeError: if isinstance(output, GenericComplexObject): obj_lines = output.property_sets