From 3afe50dfe2d58586b119e2bd390c0c422a1bcda0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 28 Jun 2016 10:57:41 -0400 Subject: [PATCH] push unicode handling into unfrack --- lib/ansible/utils/path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/utils/path.py b/lib/ansible/utils/path.py index 3d9b35f970..2ce8f40060 100644 --- a/lib/ansible/utils/path.py +++ b/lib/ansible/utils/path.py @@ -31,13 +31,13 @@ def unfrackpath(path): example: '$HOME/../../var/mail' becomes '/var/spool/mail' ''' - return os.path.normpath(os.path.realpath(os.path.expandvars(os.path.expanduser(path)))) + return os.path.normpath(os.path.realpath(os.path.expandvars(os.path.expanduser(to_bytes(path, errors='strict'))))) def makedirs_safe(path, mode=None): '''Safe way to create dirs in muliprocess/thread environments''' rpath = unfrackpath(path) - if not os.path.exists(to_bytes(rpath, errors='strict')): + if not os.path.exists(rpath): try: if mode: os.makedirs(rpath, mode)