TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
Looks like when the bot is starting up, these fields aren't populated so we get None back. We should return 0 if either of these are None
https://app.getsentry.com/pokemongof/pokemongo-bot/issues/147416492/
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
File "pokecli.py", line 490, in <module>
main()
File "pokecli.py", line 95, in main
report_summary(bot)
File "pokecli.py", line 136, in report_summary
logger.info('Total XP Earned: {} Average: {:.2f}/h'.format(metrics.xp_earned(), metrics.xp_per_hour()))
File "pokemongo_bot/metrics.py", line 28, in xp_earned
return self.xp['latest'] - self.xp['start']
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
I am having this issue. How to we alter the pokecly.py files so that I no longer get this error?
016-08-07 10:19:24,084 [PokemonGoBot] [INFO]
2016-08-07 10:19:24,084 [PokemonGoBot] [INFO]
2016-08-07 10:19:31,577 [ cli] [INFO]
2016-08-07 10:19:31,577 [ cli] [INFO] Ran for 0:00:11
Traceback (most recent call last):
File "pokecli.py", line 493, in
This is still a problem.
Looks like this happens on first login with a fresh new account.
UpdateLiveStats tries to get the XP to display the stats and fails at it.
Temporary fix I found is :
- Disabling the worker
- Running the bot once, let it catch a Pokemon, spin a Pokestop, do stuff
- Re-enable the worker
- Watch it work 👍
Can we make this fix?
yes this is what needs to be done
but it's not a fix
account just needs to be level 1 before livestats can be enabled
@MasterCATZ Yes, it's not a fix. If being level 1 is enough to make it work, we could add a level check in update_live_stats._should_display to avoid fetching stats when we're not level 1.
#4088