Remove unicode filenames on windows python 2

Need to provide unicode to shutil in order to retrieve and delete
unicode.
This commit is contained in:
Daniel A. Wozniak 2018-08-22 06:39:29 +00:00 committed by rallytime
parent 74b78835b3
commit 4b688f6347
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -547,6 +547,8 @@ def rm_rf(path):
if os.path.islink(path) or not os.path.isdir(path):
os.remove(path)
else:
if six.PY2 and salt.utils.platform.is_windows() and isinstance(path, six.string_types):
path = path.decode('utf-8')
shutil.rmtree(path, onerror=_onerror)