From eec0275b27bbe0fefad4624bbdeafddefd30a5a9 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 21 Mar 2019 15:44:00 -0700 Subject: [PATCH] Fix encoding handling in unfrackpath. --- lib/ansible/utils/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils/path.py b/lib/ansible/utils/path.py index 717cef6cf0..41ed017ef4 100644 --- a/lib/ansible/utils/path.py +++ b/lib/ansible/utils/path.py @@ -45,7 +45,7 @@ def unfrackpath(path, follow=True, basedir=None): if basedir is None: basedir = os.getcwd() - elif os.path.isfile(basedir): + elif os.path.isfile(to_bytes(basedir, errors='surrogate_or_strict')): basedir = os.path.dirname(basedir) final_path = os.path.expanduser(os.path.expandvars(to_bytes(path, errors='surrogate_or_strict')))