Failure while adding a CurseForge ModPack containing files/dirs with special characters.
Operating System
Windows
Version of PolyMC
1.4.1
Version of Qt
6.3.0
Description of bug
While importing a CurseForge ModPack, PolyMC froze for a few seconds before failing with the message "Failed to extract modpack"
After re-opening PolyMC using my Terminal Emulator and re-adding the Pack the following error appeared in the console:
30.629 W Failed to extract file "overrides/resourcepacks/\u00159\u0015lKreet\u0015a\u0015lResources\u0015r\u00157T \u00158\u0015ov0.1.0\u00150.zip" to "C:/Users/spectrapulse/AppData/Roaming/PolyMC/instances/.LAUNCHER_TEMP/{979e45df-4103-4e6a-bcec-fd454f506f98}/overrides/resourcepacks/\u00159\u0015lKreet\u0015a\u0015lResources\u0015r\u00157T \u00158\u0015ov0.1.0\u00150.zip"
30.631 C Task "InstanceImportTask(0x7b7e530)" failed: "Failed to extract modpack"
30.664 C Task "InstanceStaging(0x79078b0)" failed: "Failed to extract modpack"
Steps to reproduce
- Open the Launcher.
- Drag desired ModPack onto the launcher.
Suspected cause
The file PolyMC failed to extract contains special characters such as the § symbol which sometimes is used in Resource Packs to style the title.
I first thought it was because of Windows's Path Length Limit but its below the 260 character limit so it can't be that. Add to that that I increased the path length limit so it shouldn't be a problem anyways.
This issue is unique
- [X] I have searched the issue tracker and did not find an issue describing my bug.
Can you say which modpack is giving this problem, so that i can test locally? :x
It's a custom modpack of myself which is in the works.
But I've attached a base modpack based on fabric with just the FabricAPI included and a resourcepack which can reproduce the issue here: PolyMC-1028.zip
After review it might actually not be a PolyMC bug as it seems it has to do with the way CurseForge exports a pack.
It seems to create an archive that doesn't support UTF-8 filenames which is causing issues with different unzip implementations.
I've noticed that exporting using Windows's built-in unzip tool silently fails exporting the files and directories containing these special characters. Which is different from the way 7zip exports it as 7zip just replaces characters it doesn't know with underscores.
I'm not sure if I should close this as it might not be desirable to fail with a generic Failed to extract modpack message but I'm not sure how much control PolyMC has in this front as this possibly could just be a limitation with the library PolyMC could be using for unzipping modpacks.