Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions python/paddle/utils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ def _decompress(fname):

def _uncompress_file_zip(filepath):
with zipfile.ZipFile(filepath, 'r') as files:
file_list = files.namelist()
file_list_tmp = files.namelist()
file_list = []
for file in file_list_tmp:
file_list.append(file.replace("../", ""))

file_dir = os.path.dirname(filepath)

Expand Down Expand Up @@ -342,7 +345,10 @@ def _uncompress_file_zip(filepath):

def _uncompress_file_tar(filepath, mode="r:*"):
with tarfile.open(filepath, mode) as files:
file_list = files.getnames()
file_list_tmp = files.getnames()
file_list = []
for file in file_list_tmp:
file_list.append(file.replace("../", ""))

file_dir = os.path.dirname(filepath)

Expand Down