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

getting TypeError: ord() expected a character... #79

Closed bozdoz closed 11 years ago

bozdoz commented 11 years ago

Not sure where I'm going wrong here. Using sc2reader.read_file(), but it throws a TypeError: ord() expected a character, but string of length 0 found. I'm using it the way that is described at http://pypi.python.org/pypi/sc2reader, but it doesn't seem able to parse a replay file.

dsjoerg commented 11 years ago

Can you supply the replay file you're using, and a full transcript of the commands you're running? Also which version of sc2reader are you using -- HEAD of master ?

bozdoz commented 11 years ago

I just tested with the test replays in github, and it worked fine. My replay files don't seem to work.

I uploaded it to http://bozdoz.ca/blinked.SC2Replay

Commands I'm running:

import sc2reader r = sc2reader.read_file('blinked.SC2Replay')

Version is 0.3.2

dsjoerg commented 11 years ago

Ah OK, 0.3.2 is a very old version, that last existed a year ago. https://github.com/GraylinKim/sc2reader/commit/e226a197a2a9f3349bce7b858b78b6838a27336b

Out of curiosity, how did you get that version? By doing a "pip install" ?

Anyway, to get a newer version, get the code from github:

git clone git@github.com:GraylinKim/sc2reader.git

And then you'll be able to:

>>> import sc2reader
>>> fun = sc2reader.load_replay("/Users/david/Downloads/blinked.SC2Replay")
>>> fun.players
[Player 1 - fox (Terran), Player 2 - bozdoz (Protoss), Player 3 - Probability (Zerg), Player 4 - Dexter (Zerg)]
bozdoz commented 11 years ago

Perfect. Yes I used pip. It was the first recommendation on the http://pypi.python.org/pypi/sc2reader page. shrug. Thanks! I'll take a look at updating.

GraylinKim commented 11 years ago

Sorry about that.

I've been a terrible maintainer as far as doing releases goes. I'm currently prioritizing HotS support. When I have that reasonably stable I'll push another release out. It seems like most people eventually find Github anyway.