mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
File module - fix unicode paths and add a test (#57558)
* File module - Fix unicode paths * Add a test for unicode paths for the file module
This commit is contained in:
@@ -372,7 +372,8 @@ def initial_diff(path, state, prev_state):
|
||||
'directories': [],
|
||||
'files': [],
|
||||
}
|
||||
for base_path, sub_folders, files in os.walk(path):
|
||||
b_path = to_bytes(path, errors='surrogate_or_strict')
|
||||
for base_path, sub_folders, files in os.walk(b_path):
|
||||
for folder in sub_folders:
|
||||
folderpath = os.path.join(base_path, folder)
|
||||
walklist['directories'].append(folderpath)
|
||||
|
||||
Reference in New Issue
Block a user