Use patool directly instead of pyunpack
Conquerix opened this issue · comments
Conquerix commented
Hello,
I had to modify the fetcher.py
file is src/core
not to use pyunpack and use patool directly.
I use NixOS and the way pyunpack calls patool (as a separate program and not via the API) makes it fundamentally incompatible with NixOS.
I replaced lines 268-269 in src/core/fetcher.py
with:
import patoolib
patoolib.extract_archive(modPath, outdir=extractedDir)
And this way I could correctly extract the mods.
In hope that it will help anyone
Conquerix commented
Small edit to the modification:
import shutil
if modPath.lower().endswith(".7z") or modPath.lower().endswith(".rar"):
import patoolib
patoolib.extract_archive(modPath, outdir=extractedDir)
else:
shutil.unpack_archive(modPath, extractedDir)
The previous code didn't handle zip files well