Fix several things causing tracebacks with unicode cwd (#27731)

Fixes #27511
This commit is contained in:
Toshio Kuratomi 2017-08-04 06:25:08 -07:00 committed by Sam Doran
parent 181b31e282
commit 3f12fccd02
4 changed files with 6 additions and 6 deletions

View file

@ -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')