Skip to content

Commit

Permalink
tar_gz_to_zip extract_dir's name add str(uuid.uuid4())[:6]
Browse files Browse the repository at this point in the history
  • Loading branch information
wayyoungboy committed Nov 13, 2024
1 parent 05fcc1d commit ab16d80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import json
import hashlib
import datetime
import uuid

import tabulate
import tarfile
import socket
Expand Down Expand Up @@ -660,7 +662,7 @@ def write_append(filename, result, stdio=None):
fileobj.write(u'{}'.format(result))

def tar_gz_to_zip(temp_dir, tar_gz_file, output_zip, password, stdio):
extract_dir = os.path.join(temp_dir, 'extracted_files')
extract_dir = os.path.join(temp_dir, 'extracted_files_{0}'.format(str(uuid.uuid4())[:6]))

try:
# 1. Extract the tar.gz file
Expand Down

0 comments on commit ab16d80

Please sign in to comment.