mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
Fix encoding issues with file paths. (#50830)
* Fix encoding issues with file paths. Discovered while testing with ANSIBLE_CONFIG env var set to a path that contained unicode characters while LC_ALL=C. * Fix unit tests. * Fix another path encoding issue.
This commit is contained in:
parent
15b1a31aa8
commit
465df0ef8d
5 changed files with 13 additions and 13 deletions
|
@ -23,7 +23,7 @@ import os
|
|||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleParserError
|
||||
from ansible.module_utils._text import to_text, to_native
|
||||
from ansible.module_utils._text import to_bytes, to_text, to_native
|
||||
from ansible.playbook.play import Play
|
||||
from ansible.playbook.playbook_include import PlaybookInclude
|
||||
from ansible.plugins.loader import get_all_plugin_loaders
|
||||
|
@ -68,7 +68,7 @@ class Playbook:
|
|||
for name, obj in get_all_plugin_loaders():
|
||||
if obj.subdir:
|
||||
plugin_path = os.path.join(self._basedir, obj.subdir)
|
||||
if os.path.isdir(plugin_path):
|
||||
if os.path.isdir(to_bytes(plugin_path)):
|
||||
obj.add_directory(plugin_path)
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue