mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Fix several things causing tracebacks with unicode cwd (#27731)
Fixes #27511
This commit is contained in:
committed by
Sam Doran
parent
181b31e282
commit
3f12fccd02
@@ -75,7 +75,7 @@ def makedirs_safe(path, mode=None):
|
||||
|
||||
def basedir(source):
|
||||
""" returns directory for inventory or playbook """
|
||||
|
||||
source = to_bytes(source, errors='surrogate_or_strict')
|
||||
dname = None
|
||||
if os.path.isdir(source):
|
||||
dname = source
|
||||
@@ -88,4 +88,4 @@ def basedir(source):
|
||||
# don't follow symlinks for basedir, enables source re-use
|
||||
dname = os.path.abspath(dname)
|
||||
|
||||
return dname
|
||||
return to_text(dname, errors='surrogate_or_strict')
|
||||
|
||||
Reference in New Issue
Block a user