question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError when trying to load replay

See original GitHub issue

I get this error whenever I try to load a Replay. I tried reinstalling and installing directly from GitHub but the error persists. Any ideas on what could be causing this?

  File "<stdin>", line 1, in <module>
  File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 85, in load_replay
    return self.load(Replay, source, options, **new_options)
  File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 137, in load
    return self._load(cls, resource, filename=filename, options=options)
  File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 146, in _load
    obj = cls(resource, filename=filename, factory=self, **options)
  File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/resources.py", line 312, in __init__
    engine.run(self)
  File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/engine/engine.py", line 177, in run
    for new_event in (event_handler(event, replay) or []):
  File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/engine/plugins/context.py", line 57, in handleTargetUnitCommandEvent
    self.last_target_ability_event[event.player.pid] = event
AttributeError: 'NoneType' object has no attribute 'pid'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lfrickencommented, Nov 20, 2018

So I wanted to try solving this myself (I really want to use this library for those replays by blizzard). I had resources.py use replay.details.backup and replay.initData.backup and it successfully loaded some stuff, including players. But there were some problems.

replay.tracker.events doesn’t exist, so I can’t seem to find any UnitBornEvent’s

1reaction
StoicLoofahcommented, Nov 15, 2018

@Gusgus01 thanks for looking more deeply into this! My short answer is that I would love to have a good solution for this but don’t have a strong opinion on how to do it.

In the general case, it sounds like we won’t stumble across replays with this problem in the wild: they just happen to be how Blizzard treated this particular data set, but since they are official, that makes them pretty relevant.

As I mentioned above, I really don’t understand how the archive reading logic works: most of my tweaks to sc2reader start assuming that it was unpacked properly, then working to massage that into the python class structure. I would be happy to look at any PRs that manage to avoid crashes. From there, we can talk more about how we want to fill in details e.g. using pids or placeholder data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'ChatBot' object has no attribute 'get_responce'
I am trying to make chatbot but it has some unexpected errors. please ... in replay = bot.get_responce(message) AttributeError: 'ChatBot' ...
Read more >
How to Fix AttributeError in Python - Rollbar
The Python AttributeError is an exception that occurs when an attribute reference or assignment fails. Learn how to fix it.
Read more >
Source code for stable_baselines3.her.her_replay_buffer
:param env: Environment from which we want to get the time limit. ... Replay buffer for sampling HER (Hindsight Experience Replay) transitions.
Read more >
sqlalchemy.orm.attributes — bob.db.replay 3.0.3 documentation
try : return getattr(descriptor, attribute) except AttributeError: try: return ... An instance attribute that is loaded by a callable function will also not ......
Read more >
Replay Control — RenderDoc documentation
While loading the capture for replay, the driver encountered corrupted or invalid ... This function blocks while trying to initialise callstack resolving, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found