defaultnamehere / tinder-detective

Find your Facebook friends' Tinder profiles. Don't actually use this by the way that's weird. Not even in a good way.
MIT License
701 stars 60 forks source link

builtins.UnicodeEncodeError #12

Open WurstCommander opened 8 years ago

WurstCommander commented 8 years ago

After starting the app and going to localhost:5000

I get the following error:

builtins.UnicodeEncodeError

UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f512' in position 91: character maps to

Traceback (most recent call last) File "C:\python30\lib\site-packages\flask\app.py", line 2000, in call return self.wsgi_app(environ, start_response) File "C:\python30\lib\site-packages\flask\app.py", line 1991, in wsgi_app response = self.make_response(self.handle_exception(e)) File "C:\python30\lib\site-packages\flask\app.py", line 1567, in handle_exception reraise(exc_type, exc_value, tb) File "C:\python30\lib\site-packages\flask_compat.py", line 33, in reraise raise value File "C:\python30\lib\site-packages\flask\app.py", line 1988, in wsgi_app response = self.full_dispatch_request() File "C:\python30\lib\site-packages\flask\app.py", line 1641, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\python30\lib\site-packages\flask\app.py", line 1544, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\python30\lib\site-packages\flask_compat.py", line 33, in reraise raise value File "C:\python30\lib\site-packages\flask\app.py", line 1639, in full_dispatch_request rv = self.dispatch_request() File "C:\python30\lib\site-packages\flask\app.py", line 1625, in dispatch_request return self.view_functionsrule.endpoint File "D:\0815_Spielwiese\tinder-detective-master\app.py", line 13, in index profiles = stalker.get_profiles() File "D:\0815_Spielwiese\tinder-detective-master\api.py", line 142, in get_profiles friends = self.get_facebook_friends_tinder_ids() File "D:\0815_Spielwiese\tinder-detective-master\api.py", line 85, in get_facebook_friends_tinder_ids be_creepy = input("Sure you want to look at your Facebook friends' Tinder profiles? They might not like that. 🔒 [y/n]: ").lower() in ("y", "yes") File "C:\python30\lib\encodings\cp850.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f512' in position 91: character maps to

esquire900 commented 8 years ago

In windows cli, run "chcp 65001"

hrosdei commented 8 years ago

I have the same issue. Were you able to resolve the problem @WurstCommander?

WurstCommander commented 8 years ago

chcp 65001 before executing the app solved it.

but I opend the *.py files in pycharm and saved, maybe it changed the encoding too?

ghost commented 7 years ago

advice from an utter n00b: Issue from what I can tell are the emojis used throughout api.py - I just replaced those with plaintext and it started playing nicely again.