diff --git a/changelogs/fragments/psrp-json-loads-bytes.yml b/changelogs/fragments/psrp-json-loads-bytes.yml new file mode 100644 index 00000000000..6cc4c18bc42 --- /dev/null +++ b/changelogs/fragments/psrp-json-loads-bytes.yml @@ -0,0 +1,2 @@ +bugfixes: + - psrp connection plugin - ``to_text(stdout)`` before ``json.loads`` in psrp.Connection.put_file in case ``stdout`` is bytes. diff --git a/lib/ansible/plugins/connection/psrp.py b/lib/ansible/plugins/connection/psrp.py index 38a6259bcd2..f03eb8782ce 100644 --- a/lib/ansible/plugins/connection/psrp.py +++ b/lib/ansible/plugins/connection/psrp.py @@ -470,7 +470,7 @@ class Connection(ConnectionBase): if rc != 0: raise AnsibleError(to_native(stderr)) - put_output = json.loads(stdout) + put_output = json.loads(to_text(stdout)) remote_sha1 = put_output.get("sha1") if not remote_sha1: