mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
74b78835b3
commit
4b688f6347
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue