mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Fix several things causing tracebacks with unicode cwd (#27731)
Fixes #27511
This commit is contained in:
parent
181b31e282
commit
3f12fccd02
4 changed files with 6 additions and 6 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue