ggtracker / ggtracker/sc2reader
sc2reader breaks on sc2AI bot replays
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 169
- Forks
- 152
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sc2reader/resources.py at load_details(), line 389, and reproduce the failure using the supplied SC2Replay file and the load_replay call shown in the traceback. Trace how cache_handles is populated for this replay and make loading complete without the IndexError. Confirm the supplied sc2AI bot replay can be loaded successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100