Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode ASCII Error when display fort names in some lanaguages #1814

Closed
Viper896 opened this issue Jul 30, 2016 · 14 comments
Closed

Decode ASCII Error when display fort names in some lanaguages #1814

Viper896 opened this issue Jul 30, 2016 · 14 comments

Comments

@Viper896
Copy link
Contributor

Needs Verification:

Traceback (most recent call last):
File "pokecli.py", line 464, in
main()
File "pokecli.py", line 68, in main
bot.tick()
File "/Users/mike/repos/fun/PokemonGo-Bot/pokemongo_bot/init.py", line 84, in tick
if worker.work() == WorkerResult.RUNNING:
File "/Users/mike/repos/fun/PokemonGo-Bot/pokemongo_bot/cell_workers/move_to_fort_worker.py", line 43, in work
logger.log('Moving towards fort {}, {} left'.format(fort_name, format_dist(dist, unit)))
File "/Users/mike/repos/fun/PokemonGo-Bot/pokemongo_bot/logger.py", line 21, in log
print('[' + time.strftime("%H:%M:%S") + '] ' + string)
File "/Users/mike/repos/fun/PokemonGo-Bot/lib/python2.7/codecs.py", line 369, in write
data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 31: ordinal not in range(128)


From Slack Chat:
It's probably due to having forts names in a different language (greek in my case)

commit: 2f277fd7d08ff9a7ad45cf46e102a00db7ba9fdf
>Display Fort Name instead of Fort ID in Log (#1801)
@hklcf
Copy link
Contributor

hklcf commented Jul 30, 2016

same here

image

2f277fd

@CapCap
Copy link
Contributor

CapCap commented Jul 30, 2016

import sys  

reload(sys)  
sys.setdefaultencoding('utf8')

@hklcf
Copy link
Contributor

hklcf commented Jul 30, 2016

@CapCap waiting for your PR 👍

@xorinzor
Copy link

Confirmed, having this issue too.

Traceback (most recent call last):
  File "pokecli.py", line 464, in <module>
    main()
  File "pokecli.py", line 68, in main
    bot.tick()
  File "C:\Users\xorinzor\Desktop\PokemonGo-Bot\pokemongo_bot\__init__.py", line 84, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "C:\Users\xorinzor\Desktop\PokemonGo-Bot\pokemongo_bot\cell_workers\move_to_fort_worker.py", line 43, in work
    logger.log('Moving towards fort {}, {} left'.format(fort_name, format_dist(dist, unit)))
  File "C:\Users\xorinzor\Desktop\PokemonGo-Bot\pokemongo_bot\logger.py", line 21, in log
    print('[' + time.strftime("%H:%M:%S") + '] ' + string)
  File "C:\Python27\lib\codecs.py", line 369, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 41: ordinal not in range(128)

@Simbe90
Copy link

Simbe90 commented Jul 30, 2016

Got this same error on a Mac. Tried doing a clean installation of the latest dev 2f277fd but no luck. It ran for a couple of mins and then crashed.

@aurizasalim
Copy link

Confirmed, happened to me too..

[17:12:30] Starting PokemonGo Bot....
[17:12:30] [x] Next egg incubates in 2.00 km
[17:12:31] Now at Pokestop: Havsstenen Av Håkan Bonde
[17:12:31] Spinning ...
[17:12:32] Possibly searching too often - taking a short rest :)
[17:12:33]
[17:12:33] Ran for 0:00:09
[17:12:33] Total XP Earned: 0  Average: 0.00/h
[17:12:33] Travelled 0.00km
[17:12:33] Visited 0 stops
[17:12:33] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before
[17:12:33] Threw 0 pokeballs
[17:12:33] Earned 0 Stardust
[17:12:33]
[17:12:33] Highest CP Pokemon:
[17:12:33] Most Perfect Pokemon:
Traceback (most recent call last):
  File "pokecli.py", line 464, in <module>
    main()
  File "pokecli.py", line 68, in main
    bot.tick()
  File "C:\pokebot\PokemonGo-Bot-XXXXX@gmail.com\pokemongo_bot\__init__.py", line 84, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "C:\pokebot\PokemonGo-Bot-XXXXX@gmail.com\pokemongo_bot\cell_workers\move_to_fort_worker.py", line 43, in work
    logger.log('Moving towards fort {}, {} left'.format(fort_name, format_dist(dist, unit)))
  File "C:\pokebot\PokemonGo-Bot-XXXXX@gmail.com\pokemongo_bot\logger.py", line 21, in log
    print('[' + time.strftime("%H:%M:%S") + '] ' + string)
  File "C:\Python27\lib\codecs.py", line 357, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 35: ordinal not in range(128)
`

@sgitkene
Copy link

already an issue and a pr has been submitted: #1806

@Simbe90
Copy link

Simbe90 commented Jul 30, 2016

Does this affect older commits too or can we just revert back while waiting for a fix?

@xorinzor
Copy link

@Simbe90 not all old commits, but you'll probably have to figure out yourself at which commit this was introduced

@crusardri
Copy link

same here: 2f277fd

@Simbe90
Copy link

Simbe90 commented Jul 30, 2016

Reverted back to 93dbca6 from earlier today with git reset --hard 93dbca6 and seems to be working without issue so far.

@mehdi-S
Copy link

mehdi-S commented Jul 30, 2016

confirmed
more info when it's appening :

[08:16:38] 50 xp
[08:16:39] - 2x Pokeball (Total: 83)
[08:16:39] - 1x Potion (Total: 1)
[08:16:39] PokeStop on cooldown. Time left: 5 minutes, 1 second
[08:16:41] Walking from (48.891486, 2.389614) to [48.891486, 2.389614] 0.00km
[08:16:42] -- Recycled 3x Pokeball (keeps only 80 maximum)
[08:16:43] -- Recycled 1x Potion (keeps only 0 maximum)
[08:16:43] Moving towards fort Jardin de stelles, 0.05km left
[08:16:48] Moving towards fort Jardin de stelles, 0.05km left
[08:16:52] Moving towards fort Jardin de stelles, 0.05km left
[08:16:59] Now at Pokestop: Jardin de stelles
[08:16:59] Spinning ...
[08:17:00] Loot:
[08:17:00] 50 xp
[08:17:00] - 1x Revive (Total: 31)
[08:17:00] - 1x Potion (Total: 1)
[08:17:00] - 1x Pokeball (Total: 81)
[08:17:00] PokeStop on cooldown. Time left: 5 minutes, 0 seconds
[08:17:03]
[08:17:03] Ran for 0:00:34
[08:17:03] Total XP Earned: 150  Average: 15808.77/h
[08:17:03] Travelled 0.00km
[08:17:03] Visited 3 stops
[08:17:03] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before
[08:17:03] Threw 0 pokeballs
[08:17:03] Earned 0 Stardust
[08:17:03]
[08:17:03] Highest CP Pokemon:
[08:17:03] Most Perfect Pokemon:
Traceback (most recent call last):
  File "pokecli.py", line 464, in <module>
    main()
  File "pokecli.py", line 68, in main
    bot.tick()
  File "/root/bot2/pokemongo_bot/__init__.py", line 84, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/root/bot2/pokemongo_bot/cell_workers/move_to_fort_worker.py", line 43, in work
    logger.log('Moving towards fort {}, {} left'.format(fort_name, format_dist(dist, unit)))
  File "/root/bot2/pokemongo_bot/logger.py", line 21, in log
    print('[' + time.strftime("%H:%M:%S") + '] ' + string)
  File "/usr/lib/python2.7/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128)

@ShapeShifter499
Copy link

I also have this issue

(PokemonGo-Bot) [raansu@Y40-80 PokemonGo-Bot]$ ./run.sh 
[06:05:07] PokemonGO Bot v1.0
[06:05:07] Configuration initialized
[06:05:07] [x] Coordinates found in passed in location, not geocoding.
[06:05:07] 
[06:05:07] Location Found: 37.808673,-122.409821
[06:05:07] GeoPosition: (37.808673, -122.409821, 0)
[06:05:07] 
[06:05:07] [x] Parsing cached location...
[06:05:07] 
[06:05:07] [x] Last location flag used. Overriding passed in location
[06:05:07] [x] Last in-game location was set as: (37.810944211787046, -122.41041474099767, 0)
[06:05:07] 
[06:05:07] Attempting login to Pokemon Go.
[06:05:08] Login to Pokemon Go successful.
[06:05:08] 
[06:05:08] --- ShapeShifter499 ---
[06:05:08] Level: 22 (Next Level: 74722 XP) (Total: 360278 XP)
[06:05:08] Pokemon Captured: 1315 | Pokestops Visited: 1096
[06:05:08] Pokemon Bag: 387/450
[06:05:08] Items: 230/450
[06:05:08] Stardust: 131 | Pokecoins: 40
[06:05:08] PokeBalls: 10 | GreatBalls: 40 | UltraBalls: 26
[06:05:08] RazzBerries: 0 | BlukBerries: 0 | NanabBerries: 0
[06:05:08] LuckyEgg: 0 | Incubator: 0 | TroyDisk: 3
[06:05:08] Potion: 20 | SuperPotion: 37 | HyperPotion: 42
[06:05:08] Incense: 0 | IncenseSpicy: 0 | IncenseCool: 0
[06:05:08] Revive: 50 | MaxRevive: 0
[06:05:08] 
[06:05:08] 
[06:05:09] Starting PokemonGo Bot....
[06:05:09] Server seems to be busy or offline - try again - 1/5
[06:05:11] [x] Next egg incubates in 4.02 km
[06:05:12] No lucky eggs... skipping evolve!
[06:05:13] -- Recycled 17x Super Potion (keeps only 20 maximum) 
[06:05:13] -- Recycled 12x Hyper Potion (keeps only 30 maximum) 
[06:05:13] Walking from (37.810944211787046, -122.41041474099767) to [37.810944211787046, -122.41041474099767] 0.00km
[06:06:27] Walking from (37.810944211787046, -122.41041474099767) to [37.81274421178705, -122.41041474099767] 0.20km
[06:08:50] Walking from (37.81274421178705, -122.41041474099767) to [37.81274421178705, -122.40861474099766] 0.16km
[06:10:04] Walking from (37.81274421178705, -122.40861474099766) to [37.810944211787046, -122.40861474099766] 0.20km
[06:10:07] [x] Next egg incubates in 3.76 km
[06:12:33] Walking from (37.810944211787046, -122.40861474099766) to [37.80914421178704, -122.40861474099766] 0.20km
[06:15:09] Walking from (37.80914421178704, -122.40861474099766) to [37.80914421178704, -122.41041474099767] 0.16km
[06:16:37] Walking from (37.80914421178704, -122.41041474099767) to [37.80914421178704, -122.41221474099767] 0.16km
[06:17:47] Walking from (37.80914421178704, -122.41221474099767) to [37.810944211787046, -122.41221474099767] 0.20km
[06:19:03] [x] Next egg incubates in 3.32 km
[06:20:11] Walking from (37.810944211787046, -122.41221474099767) to [37.81274421178705, -122.41221474099767] 0.20km
[06:22:39] Walking from (37.81274421178705, -122.41221474099767) to [37.814544211787045, -122.41221474099767] 0.20km
[06:25:07] Walking from (37.814544211787045, -122.41221474099767) to [37.814544211787045, -122.41041474099767] 0.16km
[06:25:08] [x] Next egg incubates in 2.82 km
[06:26:18] Walking from (37.814544211787045, -122.41041474099767) to [37.814544211787045, -122.40861474099766] 0.16km
[06:27:28] Walking from (37.814544211787045, -122.40861474099766) to [37.814544211787045, -122.40681474099766] 0.16km
[06:28:47] Walking from (37.814544211787045, -122.40681474099766) to [37.81274




 421178705, -122.40681474099766] 0.20km
[06:30:03] [x] Next egg incubates in 2.66 km
[06:31:17] Walking from (37.81274421178705, -122.40681474099766) to [37.810944211787046, -122.40681474099766] 0.20km
[06:33:50] Walking from (37.810944211787046, -122.40681474099766) to [37.80914421178704, -122.40681474099766] 0.20km
[06:35:04] Session stale, re-logging in
[06:35:04] Attempting login to Pokemon Go.
[06:35:05] Login to Pokemon Go successful.
[06:36:17] Moving towards fort Sidney Rudy Waterfront Park, 0.17km left
[06:37:31] Walking from (37.808718854812774, -122.40762486136505) to [37.80734421178705, -122.40681474099766] 0.17km
[06:39:57] Something rustles nearby!
[06:39:58] A Wild Eevee appeared! [CP 224] [Potential 0.56]
[06:39:58] IV [Stamina/Attack/Defense] = [4/15/6]
[06:40:01] Using Pokeball (chance: 42.64%)... (9 left!)
[06:40:02] [-] Attempted to capture Eevee - failed.. trying again!
[06:40:04] Using Pokeball (chance: 42.64%)... (8 left!)
[06:40:04] [-] Attempted to capture Eevee - failed.. trying again!
[06:40:07] Using Pokeball (chance: 42.64%)... (7 left!)
[06:40:07] [-] Attempted to capture Eevee - failed.. trying again!
[06:40:10] Using Pokeball (chance: 42.64%)... (6 left!)
[06:40:10] [-] Attempted to capture Eevee - failed.. trying again!
[06:40:13] Using Pokeball (chance: 42.64%)... (5 left!)
[06:40:13] Captured Eevee! [CP 224] [Potential 0.56] [4/15/6] [+110 exp]
[06:40:19] Now at Pokestop: Pier 39
[06:40:19] Spinning ...
[06:40:19] Loot: 
[06:40:19] 50 xp
[06:40:20] - 2x Pokeball (Total: 7)
[06:40:20] - 1x Razz Berry (Total: 1)
[06:40:20] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:40:22] Moving towards fort Barbary Coast Trail Plaque, 0.04km left
[06:40:22] Arrived at pokestop.
[06:40:22] Lured pokemon at fort f044708a68e943a5ac21de733aea06aa.16
[06:40:22] A Wild Psyduck appeared! [CP 627] [Potential 0.64]
[06:40:22] IV [Stamina/Attack/Defense] = [12/2/15]
[06:40:26] Catch Rate with normal Pokeball is low (31.92%). Throwing Razz Berry... (0 left!)
[06:40:26] Catch Rate with normal Pokeball has increased to 47.88%
[06:40:26] Using Pokeball (chance: 47.88%)... (6 left!)
[06:40:32] Captured Psyduck! [CP 627] [Potential 0.64] [12/2/15] [+110 exp]
[06:40:37] Now at Pokestop: Barbary Coast Trail Plaque
[06:40:37] Spinning ...
[06:40:37] Loot: 
[06:40:37] 50 xp
[06:40:37] - 1x Pokeball (Total: 7)
[06:40:37] - 1x Revive (Total: 51)
[06:40:37] - 1x Hyper Potion (Total: 31)
[06:40:37] PokeStop on cooldown. Time left: 5 minutes, 20 seconds
[06:40:39] Walking from (37.807176, -122.406373) to [37.80734421178705, -122.40861474099766] 0.20km
[06:40:44] Releasing Eevee with CP 224 and IV 0.56. Matching release rule: CP < 376 AND IV < 0.8. 
[06:40:44] Exchanging Eevee [CP 224] [Potential 0.56] for candy!
[06:41:59] -- Recycled 1x Hyper Potion (keeps only 30 maximum) 
[06:43:12] Walking from (37.80734421178705, -122.40861474099766) to [37.80734421178705, -122.41041474099767] 0.16km
[06:44:25] Walking from (37.80734421178705, -122.41041474099767) to [37.80734421178705, -122.41221474099767] 0.16km
[06:45:44] Walking from (37.80734421178705, -122.41221474099767) to [37.80734421178705, -122.41401474099767] 0.16km
[06:46:56] Something rustles nearby!
[06:46:57] A Wild Zubat appeared! [CP 130] [Potential 0.29]
[06:46:57] IV [Stamina/Attack/Defense] = [1/4/8]
[06:46:59] Using Pokeball (chance: 50.05%)... (6 left!)
[06:47:00] Captured Zubat! [CP 130] [Potential 0.29] [1/4/8] [+110 exp]
[06:47:05] Now at Pokestop: Long Shore Men's Memorial Building
[06:47:05] Spinning ...
[06:47:06] Loot: 
[06:47:06] 50 xp
[06:47:06] - 2x Pokeball (Total: 8)
[06:47:06] - 1x Revive (Total: 52)
[06:47:06] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:47:08] Moving towards fort Something Fishy, 0.08km left
[06:47:08] Arrived at pokestop.
[06:47:08] Now at Pokestop: Something Fishy
[06:47:08] Spinning ...
[06:47:09] Loot: 
[06:47:09] 50 xp
[06:47:09] - 1x Revive (Total: 53)
[06:47:09] - 1x Greatball (Total: 41)
[06:47:09] - 2x Ultraball (Total: 28)
[06:47:09] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:47:11] Walking from (37.806728, -122.413499) to [37.80914421178704, -122.41401474099767] 0.27km
[06:47:15] Releasing Zubat with CP 130 and IV 0.29. Matching release rule: CP < 225 AND IV < 0.8. 
[06:47:15] Exchanging Zubat [CP 130] [Potential 0.29] for candy!
[06:48:33] -- Recycled 1x Greatball (keeps only 40 maximum) 
[06:48:34] Moving towards fort Rescue the Rainforest, 0.12km left
[06:48:34] Arrived at pokestop.
[06:48:34] Lured pokemon at fort d0d3e9281a1d4b219ad337fff1f0a35b.16
[06:48:34] A Wild Magikarp appeared! [CP 123] [Potential 0.42]
[06:48:34] IV [Stamina/Attack/Defense] = [9/9/1]
[06:48:37] Using Pokeball (chance: 45.74%)... (7 left!)
[06:48:38] [-] Attempted to capture Magikarp - failed.. trying again!
[06:48:40] Using Pokeball (chance: 45.74%)... (6 left!)
[06:48:40] [-] Attempted to capture Magikarp - failed.. trying again!
[06:48:42] Using Pokeball (chance: 45.74%)... (5 left!)
[06:48:43] Captured Magikarp! [CP 123] [Potential 0.42] [9/9/1] [+110 exp]
[06:48:48] Now at Pokestop: Rescue the Rainforest
[06:48:48] Spinning ...
[06:48:48] Loot: 
[06:48:48] 50 xp
[06:48:49] - 2x Pokeball (Total: 7)
[06:48:49] - 1x Super Potion (Total: 21)
[06:48:49] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:50:02] -- Recycled 1x Super Potion (keeps only 20 maximum) 
[06:50:02] Something rustles nearby!
[06:50:02] A Wild Psyduck appeared! [CP 40] [Potential 0.27]
[06:50:02] IV [Stamina/Attack/Defense] = [10/0/2]
[06:50:05] Using Pokeball (chance: 100.00%)... (6 left!)
[06:50:05] Captured Psyduck! [CP 40] [Potential 0.27] [10/0/2] [+110 exp]
[06:50:11] Now at Pokestop: Aquatic Sunken Ocean Statue
[06:50:11] Spinning ...
[06:50:11] Loot: 
[06:50:11] 50 xp
[06:50:12] - 3x Pokeball (Total: 9)
[06:50:12] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:50:14] Moving towards fort San Francisco Bay Trail Fisherman's Wharf, 0.05km left
[06:50:14] Arrived at pokestop.
[06:50:14] Now at Pokestop: San Francisco Bay Trail Fisherman's Wharf
[06:50:14] Spinning ...
[06:50:14] Loot: 
[06:50:14] 50 xp
[06:50:15] - 2x Pokeball (Total: 11)
[06:50:15] - 1x Greatball (Total: 41)
[06:50:15] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:50:17] Walking from (37.809015, -122.414513) to [37.810944211787046, -122.41401474099767] 0.22km
[06:50:21] Releasing Psyduck with CP 40 and IV 0.27. Matching release rule: CP < 386 AND IV < 0.8. 
[06:50:21] Exchanging Psyduck [CP 40] [Potential 0.27] for candy!
[06:51:34] -- Recycled 1x Greatball (keeps only 40 maximum) 
[06:51:34] Moving towards fort Ferry Arch, 0.12km left
[06:51:34] Arrived at pokestop.
[06:51:34] Lured pokemon at fort b2f9d89e774f4b5cad45b8388fa47099.12
[06:51:35] A Wild Meowth appeared! [CP 389] [Potential 0.8]
[06:51:35] IV [Stamina/Attack/Defense] = [15/12/9]
[06:51:38] Using Greatball (chance: 46.80%)... (40 left!)
[06:51:39] Captured Meowth! [CP 389] [Potential 0.8] [15/12/9] [+110 exp]
[06:51:44] Now at Pokestop: Ferry Arch
[06:51:44] Spinning ...
[06:51:44] Loot: 
[06:51:44] 50 xp
[06:51:44] - 2x Pokeball (Total: 13)
[06:51:44] - 1x Ultraball (Total: 29)
[06:51:44] PokeStop on cooldown. Time left: 5 minutes, 20 seconds
[06:51:50] [x] Next egg incubates in 2.39 km
[#] Successfully evolved Meowth with 380 CP and 0.93 IV!
[06:53:00] Moving towards fort Protecting the Coast Pledge , 0.12km left
[06:53:00] Arrived at pokestop.
[06:53:00] Lured pokemon at fort 7fac3f2e0a5b46ff9c890d122e71d9b5.16
[06:53:05] Now at Pokestop: Protecting the Coast Pledge 
[06:53:05] Spinning ...
[06:53:06] Loot: 
[06:53:06] 50 xp
[06:53:06] - 3x Pokeball (Total: 16)
[06:53:06] - 1x Ultraball (Total: 30)
[06:53:06] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:54:26] Moving towards fort Pier 43 1/2, 0.19km left
[06:55:48] Moving towards fort Pier 43 1/2, 0.09km left
[06:55:48] Arrived at pokestop.
[06:55:48] Lured pokemon at fort 48d3251419f141b6ab54975612673628.16
[06:55:48] A Wild Magikarp appeared! [CP 16] [Potential 0.47]
[06:55:48] IV [Stamina/Attack/Defense] = [4/15/2]
[06:55:52] Using Pokeball (chance: 100.00%)... (15 left!)
[06:55:53] Captured Magikarp! [CP 16] [Potential 0.47] [4/15/2] [+110 exp]
[06:55:58] Now at Pokestop: Pier 43 1/2
[06:55:58] Spinning ...
[06:55:58] Loot: 
[06:55:58] 100 xp
[06:55:59] - 6x Pokeball (Total: 21)
[06:55:59] - 1x Revive (Total: 54)
[06:55:59] PokeStop on cooldown. Time left: 5 minutes, 21 seconds
[06:56:06] Releasing Magikarp with CP 16 and IV 0.47. Matching release rule: CP < 91 AND IV < 0.8. 
[06:56:06] Exchanging Magikarp [CP 16] [Potential 0.47] for candy!
[06:57:22] 
[06:57:22] Ran for 0:52:16
[06:57:22] Total XP Earned: 2320  Average: 2663.54/h
[06:57:22] Travelled 1.63km
[06:57:22] Visited 10 stops
[06:57:22] Encountered 7 pokemon, 7 caught, 0 released, 1 evolved, 1 never seen before
[06:57:22] Threw 13 pokeballs
[06:57:22] Earned 700 Stardust
[06:57:22] 
[06:57:22] Highest CP Pokemon: Psyduck [CP: 627] [IV: 12/2/15] Potential: 0.64 
[06:57:22] Most Perfect Pokemon: Meowth [CP: 389] [IV: 15/12/9] Potential: 0.8 
Traceback (most recent call last):
  File "pokecli.py", line 464, in <module>
    main()
  File "pokecli.py", line 68, in main
    bot.tick()
  File "/home/raansu/PokemonGo-Bot/pokemongo_bot/__init__.py", line 84, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/home/raansu/PokemonGo-Bot/pokemongo_bot/cell_workers/move_to_fort_worker.py", line 43, in work
    logger.log('Moving towards fort {}, {} left'.format(fort_name, format_dist(dist, unit)))
  File "/home/raansu/PokemonGo-Bot/pokemongo_bot/logger.py", line 21, in log
    print('[' + time.strftime("%H:%M:%S") + '] ' + string)
  File "/home/raansu/PokemonGo-Bot/lib/python2.7/codecs.py", line 369, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 34: ordinal not in range(128)
(PokemonGo-Bot) [raansu@Y40-80 PokemonGo-Bot]$

GIT Commit: 2f277fd

@pierrecholhot
Copy link

For those impatient to get the fix, I can confirm that @CapCap solution works. Adding the following lines in pokecli.py (at around line 42) fixes the issue.

reload(sys)
sys.setdefaultencoding('utf8')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests