TypeError: not all arguments converted during string formatting
Expected Behavior
For Bot to Work
Actual Behavior
Traceback (most recent call last): File "C:\Python27\lib\logging__init__.py", line 861, in emit msg = self.format(record) File "C:\Python27\lib\logging__init__.py", line 734, in format return fmt.format(record) File "C:\Python27\lib\logging__init__.py", line 465, in format record.message = record.getMessage() File "C:\Python27\lib\logging__init__.py", line 329, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting
Steps to Reproduce
python pokecli.py
Other Information
OS: Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here) Python Version: Python 2.7.12
https://github.com/PokemonGoF/PokemonGo-Bot/issues/2808
the same error I got after about 30 min working on: Python 2.7.10 OS: Mac OS X 10.10.5 commit a77cb6cd1624103a1103af2fb34bed52d058454e
I ran it several times. This error happens after exactly 30 min of running bot.
Looks like it is related to the "session stale" detection BTW, The bot is in a strange state after this error, it looks like the failing error message prevent it from being reconnected cf this line: https://github.com/PokemonGoF/PokemonGo-Bot/blob/master/pokemongo_bot/init.py#L547
I'm quite sure it related to session stale. After relogin it stops working.
Maybe self.api.activate_signature("encrypt.so") missed there.
@mico the error message suggests that it is an error in message formatting, maybe the logger fails, raises an exception and prevent the reconnection code to be executed
really, it can be. so, I've made change:
self.logger.info("Session stale, re-logging in", 'yellow')
to
self.logger.info("Session stale, re-logging in")
I'll see is it working or not.
@mico I think this is indeed the issue, yellow argument is coming from the legacy logger IMO
@mico maybe you are right about the missing call to self.api.activate_signature("encrypt.so")
@mico Since a new ApiWrapper is instanciated, it makes sense that the same methods that in _setup_api should be called
I've tried to run it for 30 minutes just with removed 'yellow' in logger, it didn't raise an error but after
2016-08-08 01:19:34,771 [PokemonGoBot] [INFO] Session stale, re-logging in 2016-08-08 01:19:34,771 [PokemonGoBot] [INFO] [login_started] Login procedure started.
it stopped working:
2016-08-08 01:19:59,399 [ SpinFort] [INFO] [pokestop_out_of_range] Pokestop Day of Cosmonautics out of range. 2016-08-08 01:19:59,399 [ SpinFort] [INFO] [pokestop_searching_too_often] Possibly searching too often, take a rest.
so, trying with self.api.activate_signature("encrypt.so")
@mico same here, I'm trying adding:
self.api.activate_signature("encrypt.so")
After self.login()
any success?
Adding the activate signature seems good to me
Suggest to update to latest version