Skip to content

a TypeError when printing events. #63

@miguelgondu

Description

@miguelgondu

First of all, thanks for maintaining this code. It's a great tool, now that SC2 is becoming the testbed for RTS AI.

There seems to be a bug when printing UnitBornEvents. I loaded a replay (that I link to) and tried to print all the events with a for loop:

replay1 = sc2reader.load_replay('solar1.SC2Replay', load_map=True)
for event in replay1.events:
    print(event)

and the first two events (PlayerSetupEvents) print just fine, but once they come to the first UnitBornEvents (the ones that concern mineral fields, for example), I get the following TypeError:


TypeError Traceback (most recent call last)
in ()
1 for event in replay1.events:
----> 2 print(event)

~/.virtualenvs/StarCraft2_venv/lib/python3.5/site-packages/sc2reader/events/tracker.py in str(self)
292
293 def str(self):
--> 294 return self._str_prefix() + "{0: >15} - Unit born {1}".format(self.unit_upkeeper, self.unit)
295
296

TypeError: non-empty format string passed to object.format


Checking the variables that are to be formatted into the string, it seems that self.unit_upkeeper is None for these particular UnitBornEvents. It may be a bug.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions