Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load reply with load_game_summary #134

Open
ryanthompson591 opened this issue Nov 30, 2020 · 1 comment
Open

Cannot load reply with load_game_summary #134

ryanthompson591 opened this issue Nov 30, 2020 · 1 comment

Comments

@ryanthompson591
Copy link

summary = sc2reader.load_game_summary(replay_file)

I get the following error

summary = sc2reader.load_game_summary(replay_file)

File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sc2reader\factories\sc2factory.py", line 113, in load_game_summary
return self.load(GameSummary, source, options, **new_options)
File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sc2reader\factories\sc2factory.py", line 143, in load
return self._load(cls, resource, filename=filename, options=options)
File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sc2reader\factories\sc2factory.py", line 152, in _load
obj = cls(resource, filename=filename, factory=self, **options)
File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sc2reader\resources.py", line 1079, in init
buffer = BitPackedDecoder(zlib.decompress(summary_file.read()[16:]))
zlib.error: Error -3 while decompressing data: incorrect header check

It's happening with all my replays.

@Talv
Copy link
Contributor

Talv commented Nov 30, 2020

You're using wrong function, intended for reading completely different kind of files (game_summary is for .s2gs files - they contain data about online match).

As for reading replays, see https://github.com/ggtracker/sc2reader#loading-replays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants