jxmorris12 / PokemonGo-Finder

Live visualization of all the pokemon in your area... and more!
GNU General Public License v3.0
171 stars 43 forks source link

Notifier.py is crashing after finding its first pokemon #15

Closed ldinatale1182 closed 7 years ago

ldinatale1182 commented 7 years ago

Expected Behavior

Notifier.py shouldn't crash!

Current Behavior

Seems like after I get notified of one pokemon, notifier.py crashes.

Possible Solution

I don't know python, but from the stacktrace it seems like there's something wrong with the unicode encoding.

Steps to Reproduce (for bugs)

Exception in thread search_thread:
Traceback (most recent call last):
  File "c:\Python27\lib\threading.py", line 801, in __bootstrap_inner
    self.run()
  File "c:\Python27\lib\threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "main.py", line 575, in main
    pokemonsJSON, ignore, only)
  File "main.py", line 675, in process_step
    notifier.pokemon_found(pokemon_obj)
  File "C:\Users\Luigi\Downloads\PokemonGo-Finder\notifier.py", line 31, in pokemon_found
    pokename = _str(pokemon["name"]).lower()
  File "C:\Users\Luigi\Downloads\PokemonGo-Finder\notifier.py", line 26, in _str
    return s.decode('utf-8').strip()
  File "c:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2640' in position 7: ordinal not in range(128)

Context

Unable to use the notifier at all.

Your Environment

ldinatale1182 commented 7 years ago

Looks like an issue when it's a nidoran that is close by.

jxmorris12 commented 7 years ago

Thanks - sorry! Fixed