PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

TypeError: not all arguments converted during string formatting

Open jninsong opened this issue 10 years ago • 16 comments

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

jninsong avatar Aug 07 '16 16:08 jninsong

https://github.com/PokemonGoF/PokemonGo-Bot/issues/2808

bruvv avatar Aug 07 '16 16:08 bruvv

the same error I got after about 30 min working on: Python 2.7.10 OS: Mac OS X 10.10.5 commit a77cb6cd1624103a1103af2fb34bed52d058454e

mico avatar Aug 07 '16 20:08 mico

I ran it several times. This error happens after exactly 30 min of running bot.

mico avatar Aug 07 '16 21:08 mico

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

Gregwar avatar Aug 07 '16 21:08 Gregwar

I'm quite sure it related to session stale. After relogin it stops working.

mico avatar Aug 07 '16 21:08 mico

Maybe self.api.activate_signature("encrypt.so") missed there.

mico avatar Aug 07 '16 21:08 mico

@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

Gregwar avatar Aug 07 '16 21:08 Gregwar

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 avatar Aug 07 '16 21:08 mico

@mico I think this is indeed the issue, yellow argument is coming from the legacy logger IMO

Gregwar avatar Aug 07 '16 21:08 Gregwar

@mico maybe you are right about the missing call to self.api.activate_signature("encrypt.so")

Gregwar avatar Aug 07 '16 22:08 Gregwar

@mico Since a new ApiWrapper is instanciated, it makes sense that the same methods that in _setup_api should be called

Gregwar avatar Aug 07 '16 22:08 Gregwar

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 avatar Aug 07 '16 22:08 mico

@mico same here, I'm trying adding: self.api.activate_signature("encrypt.so") After self.login()

Gregwar avatar Aug 07 '16 22:08 Gregwar

any success?

sangeet79 avatar Aug 07 '16 23:08 sangeet79

Adding the activate signature seems good to me

Gregwar avatar Aug 08 '16 07:08 Gregwar

Suggest to update to latest version

k4n30 avatar Aug 12 '16 01:08 k4n30