I'm new in sc2reader. I tried to load a replay, but I received the following error. Also, I tried different replay files.
from sc2reader.factories import SC2Factory
path = 'D:/Code/Test/replays/GG623.rep'
sc2 = SC2Factory()
replay = sc2.load_replay(path)
print('done')
Error:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.4\helpers\pydev\pydevd.py", line 2358, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.4\helpers\pydev\pydevd.py", line 1778, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/Code/Test/read.py", line 7, in <module>
replay = sc2.load_replay(path)
File "C:\Users\ynorouzz\AppData\Roaming\Python\Python34\site-packages\sc2reader\factories\sc2factory.py", line 85, in load_replay
return self.load(Replay, source, options, **new_options)
File "C:\Users\ynorouzz\AppData\Roaming\Python\Python34\site-packages\sc2reader\factories\sc2factory.py", line 137, in load
return self._load(cls, resource, filename=filename, options=options)
File "C:\Users\ynorouzz\AppData\Roaming\Python\Python34\site-packages\sc2reader\factories\sc2factory.py", line 146, in _load
obj = cls(resource, filename=filename, factory=self, **options)
File "C:\Users\ynorouzz\AppData\Roaming\Python\Python34\site-packages\sc2reader\resources.py", line 246, in __init__
raise exceptions.MPQError("Unable to construct the MPQArchive", e)
sc2reader.exceptions.MPQError: ('Unable to construct the MPQArchive', ValueError('Invalid file header.',))