sc2reader breaks on sc2AI bot replays
dericktseng opened this issue · 1 comments
dericktseng commented
The sc2AI bot replays seems to not have indications of region data, which breaks the parser.
Traceback (most recent call last):
File "...\tester\test.py", line 4, in <module>
replay = sc2.load_replay('701042_VeTerran_Ketroc_BlackburnAIE.SC2Replay', load_map=False)
File "...\Python\Python39\lib\site-packages\sc2reader\factories\sc2factory.py", line 88, in load_replay
return self.load(Replay, source, options, **new_options)
File "...\Python\Python39\lib\site-packages\sc2reader\factories\sc2factory.py", line 166, in load
return self._load(cls, resource, filename=filename, options=options)
File "...\Python\Python39\lib\site-packages\sc2reader\factories\sc2factory.py", line 175, in _load
obj = cls(resource, filename=filename, factory=self, **options)
File "...\Python\Python39\lib\site-packages\sc2reader\resources.py", line 302, in __init__
self.load_all_details()
File "...\Python\Python39\lib\site-packages\sc2reader\resources.py", line 444, in load_all_details
self.load_details()
File "...\Python\Python39\lib\site-packages\sc2reader\resources.py", line 389, in load_details
self.region = details["cache_handles"][0].server.lower()
IndexError: list index out of range
StoicLoofah commented
Right, I believe there may be several places where sc2reader fails due to stripped data from that set of replays.
We woudl welcome a PR that tries to address those! I think it would be fair to just leave blanks in the cases where the data is unavailable