Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding error on grp.gr_name, which can contain non-ascii chars at domain PCs #25804

Merged
merged 2 commits into from
Aug 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ansible/plugins/lookup/filetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
pass

from ansible.plugins.lookup import LookupBase
from ansible.module_utils._text import to_native
from ansible.module_utils._text import to_native, to_text

try:
from __main__ import display
Expand Down Expand Up @@ -87,7 +87,7 @@ def file_props(root, path):
except KeyError:
ret['owner'] = st.st_uid
try:
ret['group'] = grp.getgrgid(st.st_gid).gr_name
ret['group'] = to_text(grp.getgrgid(st.st_gid).gr_name)
except KeyError:
ret['group'] = st.st_gid
ret['mode'] = '0%03o' % (stat.S_IMODE(st.st_mode))
Expand Down