Skip to content

Commit

Permalink
Lmao there is a bug in zipfile
Browse files Browse the repository at this point in the history
It cannot handle windows file paths instead extracting files a file with
the name including the path dir1\\dir2\\dir3\\etc.txt
  • Loading branch information
08jne01 committed Mar 5, 2022
1 parent 55986b6 commit 170d5ae
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions get_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ def old_download_method():
else:
download_from_ftp(url, out)

with ZipFile("binaries/bin.zip") as zipObj:
print("Extracting...")
zipObj.extractall("binaries")
print("Merging...")
print(os.listdir('binaries'))
if os.path.exists("binaries/Community A-4E Binaries"):

setuptools.distutils.dir_util.copy_tree("binaries/Community A-4E Binaries", "A-4E-C")
print("Removing Extracted Directories...")
shutil.rmtree("binaries/Community A-4E Binaries")
print("Done.")
else:
print("Directory not found")

print("Extracting...")
shutil.unpack_archive("binaries/bin.zip", "binaries")
print("Merging...")
print(os.listdir('binaries'))
if os.path.exists("binaries/Community A-4E Binaries"):

setuptools.distutils.dir_util.copy_tree("binaries/Community A-4E Binaries", "A-4E-C")
print("Removing Extracted Directories...")
shutil.rmtree("binaries/Community A-4E Binaries")
print("Done.")
else:
print("Directory not found")


def create_download_link(id):
Expand Down

0 comments on commit 170d5ae

Please sign in to comment.