Closed suisseWalter closed 1 year ago
Can confirm this bug. Backtrace:
Disabling FactorioMaps mod
Traceback (most recent call last):
File "auto.py", line 880, in <module>
auto(*sys.argv[1:])
File "auto.py", line 804, in auto
zipInfo = zipObj.getinfo(os.path.join(mod[2], icon + ".png").replace('\\', '/'))
File "/usr/lib/python3.8/zipfile.py", line 1441, in getinfo
raise KeyError(
KeyError: "There is no item named 'space-exploration-graphics_0.5.10/graphics/icons/astronomic/planet-small.png' in the archive"
I made a temporary workaround for myself by removing the version from the name if it crashes, by removing everything after the underscore. It won't work in all cases, probably, because it would trigger falsely if it crashes and someone put multiple underscores in their name, but anyway:
replace: zipInfo = zipObj.getinfo(os.path.join(mod[2], icon + ".png").replace('\', '/')) with:
try:
zipInfo = zipObj.getinfo(os.path.join(mod[2], icon + ".png").replace('\\', '/'))
except KeyError:
print(mod[2])
tempName = os.path.join(mod[2], icon + ".png").replace('\\', '/')
temptemp = tempName.split("/")
temptemp[0] = temptemp[0].split("_")[0]
tempName = '/'.join(temptemp)
zipInfo = zipObj.getinfo(tempName)
many newer mods don't have their version number included in the Folder name. If it deosn't find it it just crashes outright once it tires to fetch icons.