Skip to content

Commit 66f4b29

Browse files
authored
fix hdfs download_dir (#36590)
1 parent 7bf2aa3 commit 66f4b29

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

python/paddle/distributed/fleet/utils/fs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,8 @@ def __subprocess_download(local_path, datas):
842842
if self.is_file(fs_path):
843843
return self._try_download(fs_path, local_path)
844844
# download dir
845-
_, all_files = self.ls_dir(fs_path)
846-
845+
_, all_filenames = self.ls_dir(fs_path)
846+
all_files = [fs_path + i for i in all_filenames]
847847
procs = []
848848
for i in range(multi_processes):
849849
process_datas = self._split_files(all_files, i, multi_processes)

python/paddle/fluid/tests/unittests/hdfs_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def _test_download_dir(self, fs):
195195

196196
fs.download(src_file, dst_file)
197197
local = LocalFS()
198-
self.assertTrue(local.is_exist(dst_file))
198+
self.assertTrue(local.is_exist(file1))
199199
local.delete(dst_file)
200200
fs.delete(src_file)
201201

python/paddle/fluid/tests/unittests/test_hdfs3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_hdfs(self):
4040
self._test_upload(fs)
4141
self._test_upload_dir(fs)
4242
self._test_download(fs)
43+
self._test_download_dir(fs)
4344

4445
def test_local(self):
4546
fs = LocalFS()

0 commit comments

Comments
 (0)