PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.86k stars 1.54k forks source link

TypeError: not all arguments converted during string formatting #2849

Closed jninsong closed 8 years ago

jninsong commented 8 years ago

Expected Behavior

For Bot to Work

Actual Behavior

Traceback (most recent call last): File "C:\Python27\lib\logginginit.py", line 861, in emit msg = self.format(record) File "C:\Python27\lib\logginginit.py", line 734, in format return fmt.format(record) File "C:\Python27\lib\logginginit.py", line 465, in format record.message = record.getMessage() File "C:\Python27\lib\logginginit.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

bruvv commented 8 years ago

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

mico commented 8 years ago

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 commented 8 years ago

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

Gregwar commented 8 years ago

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

mico commented 8 years ago

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

mico commented 8 years ago

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

Gregwar commented 8 years ago

@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

mico commented 8 years ago

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.

Gregwar commented 8 years ago

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

Gregwar commented 8 years ago

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

Gregwar commented 8 years ago

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

mico commented 8 years ago

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")

Gregwar commented 8 years ago

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

sangeet79 commented 8 years ago

any success?

Gregwar commented 8 years ago

Adding the activate signature seems good to me

k4n30 commented 8 years ago

Suggest to update to latest version