mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #48836 from dwoz/unicode_names_py2
Fix unicode directory listing on py2
This commit is contained in:
commit
950c1014aa
1 changed files with 5 additions and 1 deletions
|
@ -406,5 +406,9 @@ def os_walk(top, *args, **kwargs):
|
|||
This is a helper than ensures that all paths returned from os.walk are
|
||||
unicode.
|
||||
'''
|
||||
for item in os.walk(salt.utils.stringutils.to_str(top), *args, **kwargs):
|
||||
if six.PY2 and salt.utils.platform.is_windows():
|
||||
top_query = top
|
||||
else:
|
||||
top_query = salt.utils.stringutils.to_str(top)
|
||||
for item in os.walk(top_query, *args, **kwargs):
|
||||
yield salt.utils.data.decode(item, preserve_tuples=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue