GraylinKim / sc2reader

A python library that extracts data from various Starcraft II resources to power tools and services for the SC2 community. Who doesn't want to hack on the games they play?
http://sc2reader.readthedocs.org
MIT License
413 stars 85 forks source link

PlayerData issue with a HotS replay #105

Closed codingstyle closed 11 years ago

codingstyle commented 11 years ago

Hello,

I am experiencing a parser crash due to an incorrect number of arguments passed to PlayerData constructor.

The SC2Replay file is available here : https://dl.dropbox.com/u/5972771/Surveillance.SC2Replay

Build is 2.0.5.25092 Game type : 2v2 Duration : 10:50 Players :

I get this trace as a result :

Traceback (most recent call last):
  File "/usr/local/bin/sc2parse", line 9, in <module>
    load_entry_point('sc2reader==0.4.0', 'console_scripts', 'sc2parse')()
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/scripts/sc2parse.py", line 26, in main
    replay = sc2reader.load_replay(path, debug=True, load_level=1)
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/factories.py", line 68, in load_replay
    return self.load(Replay, source, options, **new_options)
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/factories.py", line 137, in load
    return self._load(cls, resource, filename=filename, options=options)
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/factories.py", line 147, in _load
    obj = cls(resource, filename=filename, factory=self, **options)
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/resources.py", line 242, in __init__
    self._read_data(data_file, self._get_reader(data_file))
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/resources.py", line 567, in _read_data
    self.raw_data[data_file] = reader(data_buffer, self)
  File "/usr/local/lib/python2.7/dist-packages/sc2reader-0.4.0-py2.7.egg/sc2reader/readers.py", line 153, in __call__
    player = PlayerData(*ordered_values(pdata))
TypeError: __new__() takes exactly 10 arguments (11 given)

Hope it helps, Chris

GraylinKim commented 11 years ago

And this is why I should really make tagged releases.

Can you please post your current commit id. On HotS HEAD (c3e3c4581d69fc2625d72eedb2be0508e837302e) it seems to be working fine right now.

codingstyle commented 11 years ago

Well, it's all my fault. I've been using the master branch. Switched the code to hots one and everything works like a charm :)

Thanks for your excellent work! Chris

GraylinKim commented 11 years ago

Well, its hardly all your fault. Its not like I've got clear instructions anywhere. Going to fix that this week though.