From 1bb674034f78260d1cbe42b35c05cc462471a6f5 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sun, 21 Oct 2018 22:59:53 +0200 Subject: [PATCH] WinRM/PSRP: Fix UTF-8 issue (#46998) * WinRM/PSRP: Fix UTF-8 issue * added changelog fragment --- changelogs/fragments/psrp-utf8.yaml | 2 ++ lib/ansible/plugins/connection/psrp.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/psrp-utf8.yaml 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