From b5a00d05d3950ca25a87669196b9ca0432ec37fc Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 19 Aug 2017 16:14:58 -0400 Subject: [PATCH] fixed #28183 - user module shadowfile update on SunOS (#28276) * fixed #28183 - user module shadowfile update on SunOS --- lib/ansible/modules/system/user.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index 79b8b36d9d1..059b04ea461 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -1348,6 +1348,7 @@ class SunOS(User): try: lines = [] for line in open(self.SHADOWFILE, 'rb').readlines(): + line = to_native(line, errors='surrogate_or_strict') fields = line.strip().split(':') if not fields[0] == self.name: lines.append(line) @@ -1442,6 +1443,7 @@ class SunOS(User): try: lines = [] for line in open(self.SHADOWFILE, 'rb').readlines(): + line = to_native(line, errors='surrogate_or_strict') fields = line.strip().split(':') if not fields[0] == self.name: lines.append(line)