mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
bb5d8fb476
The _fixup_perms2 method checks to see if the user that is being sudo'd is an unprivileged user or root. If it is an unprivileged user, some checks are done to see if becoming this user would lock the ssh user out of temp files, among other things. If this check fails, an error prints telling the user to check the documentation for becoming an unprivileged user. On some systems, the stderr prints out the unprivileged user the ssh user was trying to become contained in smartquotes. These quotes aren't in the ASCII range, and so when we're trying to call `str.format()` to combine the stderr message with the error text we get a UnicodeEncodeError as python can't coerce the smartquotes using the system default encoding. By calling `to_native()` on the error message we can ensure that the error message is a native string for the `Exception` handling, as `Exception` messages need to be native strings to avoid errors (byte strings in python2, and text strings in python3) Fixes: #18444 |
||
---|---|---|
.. | ||
ansible |