ggtracker / ggtracker/sc2reader

sc2reader breaks on sc2AI bot replays

Open
#149 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
169
Forks
152
PR merge metrics
No merged PRs in 30d

Description

https://cdn.discordapp.com/attachments/319346988904873984/875093028598083624/701042_VeTerran_Ketroc_BlackburnAIE.SC2Replay

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.