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

'ascii' codec can't decode byte 0xe6

Open stylersnico opened this issue 10 years ago • 12 comments

Hi,

On debian, with the latest release (dev) and good .so I have this problem:

2016-08-07 16:54:22,092 [       cli] [INFO] PokemonGO Bot v1.0
2016-08-07 16:54:22,095 [       cli] [INFO] Configuration initialized
2016-08-07 16:54:22,095 [pokemongo_bot.health_record.bot_event] [INFO] Health check is enabled. For more logrmation:
2016-08-07 16:54:22,095 [pokemongo_bot.health_record.bot_event] [INFO] https://github.com/PokemonGoF/PokemonGo-Bot/tree/dev#analytics
2016-08-07 16:54:22,100 [requests.packages.urllib3.connectionpool] [INFO] Starting new HTTP connection (1): www.google-analytics.com
2016-08-07 16:54:22,165 [PokemonGoBot] [INFO] [set_start_location] Setting start location.
2016-08-07 16:54:22,166 [PokemonGoBot] [INFO] [x] Coordinates found in passed in location, not geocoding.
2016-08-07 16:54:22,166 [PokemonGoBot] [INFO] [location_found] Location found: 35.6763976,139.6971372,17z (35.6763976, 139.6971372, 0.0)
2016-08-07 16:54:22,166 [PokemonGoBot] [INFO] [position_update] Now at (35.6763976, 139.6971372, 0)
2016-08-07 16:54:22,166 [PokemonGoBot] [INFO] [login_started] Login procedure started.
2016-08-07 16:54:23,531 [PokemonGoBot] [INFO] [login_successful] Login successful.
2016-08-07 16:54:24,158 [PokemonGoBot] [INFO]
2016-08-07 16:54:24,159 [PokemonGoBot] [INFO] --- xxx ---
2016-08-07 16:54:24,159 [PokemonGoBot] [INFO] Level: 24 (Next Level: 114401 XP) (Total: 595599 XP)
2016-08-07 16:54:24,159 [PokemonGoBot] [INFO] Pokemon Captured: 2318 | Pokestops Visited: 1749
2016-08-07 16:54:24,160 [PokemonGoBot] [INFO] Pokemon Bag: 210/250
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] Items: 312/350
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] Stardust: 23182 | Pokecoins: 10
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] PokeBalls: 90 | GreatBalls: 11 | UltraBalls: 117
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] RazzBerries: 41 | BlukBerries: 0 | NanabBerries: 0
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] LuckyEgg: 0 | Incubator: 0 | TroyDisk: 5
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] Potion: 5 | SuperPotion: 1 | HyperPotion: 9
2016-08-07 16:54:24,161 [PokemonGoBot] [INFO] Incense: 8 | IncenseSpicy: 0 | IncenseCool: 0
2016-08-07 16:54:24,162 [PokemonGoBot] [INFO] Revive: 23 | MaxRevive: 0
2016-08-07 16:54:24,162 [PokemonGoBot] [INFO]
2016-08-07 16:54:24,162 [PokemonGoBot] [INFO]
2016-08-07 16:54:31,631 [PokemonGoBot] [INFO] [bot_start] Starting bot...
2016-08-07 16:54:32,608 [CollectLevelUpReward] [INFO] [level_up_reward] Received level up reward: []
2016-08-07 16:54:32,609 [IncubateEggs] [INFO] [next_egg_incubates] Next egg incubates in 4.16 km
2016-08-07 16:54:32,983 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Rattata, based on cp
2016-08-07 16:54:32,983 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Spearow, based on cp
2016-08-07 16:54:32,984 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Ekans, based on cp
2016-08-07 16:54:32,984 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Sandshrew, based on cp
2016-08-07 16:54:32,985 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Parasect, based on cp
2016-08-07 16:54:32,985 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Meowth, based on cp
2016-08-07 16:54:32,985 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Psyduck, based on cp
2016-08-07 16:54:32,986 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Arcanine, based on cp
2016-08-07 16:54:32,986 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Poliwhirl, based on cp
2016-08-07 16:54:32,986 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Machoke, based on cp
2016-08-07 16:54:32,987 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Graveler, based on cp
2016-08-07 16:54:32,987 [TransferPokemon] [INFO] [future_pokemon_release] Releasing Graveler (CP 18/IV 0.64) based on rule: CP < 300 OR IV < 0
2016-08-07 16:54:33,424 [TransferPokemon] [INFO] [pokemon_release] Exchanged Graveler [CP 18] [IV 0.64] for candy.
2016-08-07 16:54:37,148 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Slowbro, based on cp
2016-08-07 16:54:37,148 [TransferPokemon] [INFO] [future_pokemon_release] Releasing Slowbro (CP 251/IV 0.56) based on rule: CP < 300 OR IV < 0
2016-08-07 16:54:37,559 [TransferPokemon] [INFO] [pokemon_release] Exchanged Slowbro [CP 251] [IV 0.56] for candy.
2016-08-07 16:54:40,662 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Seel, based on cp
2016-08-07 16:54:40,662 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Krabby, based on cp
2016-08-07 16:54:40,663 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Hitmonchan, based on cp
2016-08-07 16:54:40,663 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Rhydon, based on cp
2016-08-07 16:54:40,663 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Goldeen, based on cp
2016-08-07 16:54:41,386 [EvolvePokemon] [INFO] [pokemon_evolved] Successfully evolved Zubat with CP 355 and IV 0.87!
2016-08-07 16:54:57,835 [EvolvePokemon] [INFO] [pokemon_evolved] Successfully evolved Rattata with CP 309 and IV 0.8!
2016-08-07 16:55:23,961 [EvolvePokemon] [INFO] [pokemon_evolved] Successfully evolved Weedle with CP 252 and IV 0.93!
2016-08-07 16:55:48,965 [       cli] [INFO]
2016-08-07 16:55:48,966 [       cli] [INFO] Ran for 0:01:27
2016-08-07 16:55:48,966 [       cli] [INFO] Total XP Earned: 1500  Average: 62211.44/h
2016-08-07 16:55:48,966 [       cli] [INFO] Travelled 0.00km
2016-08-07 16:55:48,966 [       cli] [INFO] Visited 0 stops
2016-08-07 16:55:48,966 [       cli] [INFO] Encountered 0 pokemon, 0 caught, 0 released, 3 evolved, 0 never seen before
2016-08-07 16:55:48,966 [       cli] [INFO] Threw 0 pokeballs
2016-08-07 16:55:48,966 [       cli] [INFO] Earned 0 Stardust
2016-08-07 16:55:48,966 [       cli] [INFO]
2016-08-07 16:55:48,967 [       cli] [INFO] Highest CP Pokemon:
2016-08-07 16:55:48,967 [       cli] [INFO] Most Perfect Pokemon:
Traceback (most recent call last):
  File "pokecli.py", line 500, in <module>
    main()
  File "pokecli.py", line 131, in main
    raise e
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)
2016-08-07 16:55:48,976 [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 848, in _send_output
    msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128)
2016-08-07 16:55:48,977 [sentry.errors.uncaught] [ERROR] [u"UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)", u'  File "pokecli.py", line 500, in <module>', u'  File "pokecli.py", line 131, in main']

Any idea? Thanks

stylersnico avatar Aug 07 '16 14:08 stylersnico

nicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) 2016-08-07 15:11:46,033 [sentry.errors.uncaught] [ERROR] [u'OSError: dlopen(encrypt.so, 6): image not found', u' File "pokecli.py", line 501, in ', u' File "pokecli.py", line 130, in main', u' File "pokecli.py", line 139, in report_summary', u' File "pokemongo_bot/metrics.py", line 76, in capture_stats', u' File "pokemongo_bot/api_wrapper.py", line 106, in call', u' File "pokemongo_bot/api_wrapper.py", line 63, in _call', u' File "pgoapi/pgoapi.py", line 210, in call', u' File "pgoapi/rpc_api.py", line 85, in activate_signature', u' File "ctypes/init.py", line 443, in LoadLibrary', u' File "ctypes/init.py", line 365, in init']

Mac OS

gruaig avatar Aug 07 '16 14:08 gruaig

check this out #2769

rajtho avatar Aug 07 '16 14:08 rajtho

for a temp fix, try adding this to pokecli.py right after all the imports

reload(sys)
sys.setdefaultencoding('UTF8')

chadhao avatar Aug 07 '16 14:08 chadhao

@chadhao I've put this in my pokecly.py:

import sys
reload(sys)
sys.setdefaultencoding('UTF8')

Now the bot is moving again, thanks, I'll wait to see if I have another problem.

stylersnico avatar Aug 07 '16 14:08 stylersnico

@stylersnico your bot working well?

I've put in my pokecli.py but still not work.

2016-08-07 21:33:12,011 [PokemonGoBot] [INFO] [bot_start] Starting bot... 2016-08-07 21:33:13,364 [CollectLevelUpReward] [INFO] [level_up_reward] Received level up reward: [] 2016-08-07 21:33:13,364 [IncubateEggs] [INFO] [next_egg_incubates] Next egg incubates in 0.80 km 2016-08-07 21:33:13,791 [TransferPokemon] [INFO] [keep_best_release] Keeping best 1 Rattata, based on cp 2016-08-07 21:33:14,596 [TransferPokemon] [INFO] [pokemon_release] Exchanged Rattata [CP 176] [IV 0.6] for candy. 2016-08-07 21:33:16,728 [PokemonCatchWorker] [INFO] [pokemon_appeared] A wild Pidgey appeared! [CP 92] [Potential 0.42] [S/A/D 3/11/5] 2016-08-07 21:33:18,900 [PokemonCatchWorker] [INFO] [threw_pokeball] Used Pokeball, with chance 62.29 (64 left) 2016-08-07 21:33:20,003 [PokemonCatchWorker] [INFO] [pokemon_caught] Captured Pidgey! [CP 92] [Potential 0.42] [3/11/5] [+210 exp] 2016-08-07 21:33:25,765 [ cli] [INFO] 2016-08-07 21:33:25,765 [ cli] [INFO] Ran for 0:00:25 2016-08-07 21:33:25,765 [ cli] [INFO] Total XP Earned: 210 Average: 29709.06/h 2016-08-07 21:33:25,765 [ cli] [INFO] Travelled 0.00km 2016-08-07 21:33:25,766 [ cli] [INFO] Visited 0 stops 2016-08-07 21:33:25,766 [ cli] [INFO] Encountered 1 pokemon, 1 caught, 0 released, 0 evolved, 0 never seen before 2016-08-07 21:33:25,766 [ cli] [INFO] Threw 1 pokeball 2016-08-07 21:33:25,766 [ cli] [INFO] Earned 100 Stardust 2016-08-07 21:33:25,766 [ cli] [INFO] 2016-08-07 21:33:25,766 [ cli] [INFO] Highest CP Pokemon: Pidgey [CP: 92] [IV: 3/11/5] Potential: 0.42 2016-08-07 21:33:25,766 [ cli] [INFO] Most Perfect Pokemon: Pidgey [CP: 92] [IV: 3/11/5] Potential: 0.42 Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 129, in main raise e UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128) 2016-08-07 21:33:25,773 [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/) Traceback (most recent call last): File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/Users/tumdev/Desktop/pokemon/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request self.endheaders(body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 891, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) 2016-08-07 21:33:25,774 [sentry.errors.uncaught] [ERROR] [u"UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)", u' File "pokecli.py", line 493, in ', u' File "pokecli.py", line 129, in main']

ctheidea avatar Aug 07 '16 14:08 ctheidea

Yes, mine is working well.

Check this too: https://github.com/PokemonGoF/PokemonGo-Bot/issues/2769#issuecomment-238078424

stylersnico avatar Aug 07 '16 14:08 stylersnico

Created a pull request for this: https://github.com/PokemonGoF/PokemonGo-Bot/pull/2819

stylersnico avatar Aug 07 '16 14:08 stylersnico

seems that they've already got a PR to fix this problem see Fix encoding errors #2816

chadhao avatar Aug 07 '16 14:08 chadhao

@chadhao Which number? I don't have found anything similar in PR's

stylersnico avatar Aug 07 '16 14:08 stylersnico

Now I get this error on my RPi:

UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte

BlazeMuisNL avatar Aug 07 '16 14:08 BlazeMuisNL

@stylersnico I dont know either, they just mentioned it in PR I referenced above.

chadhao avatar Aug 07 '16 15:08 chadhao

This issue is closed for me. Thanks.

stylersnico avatar Aug 08 '16 06:08 stylersnico