tinder-detective icon indicating copy to clipboard operation
tinder-detective copied to clipboard

builtins.UnicodeEncodeError

Open WurstCommander opened this issue 9 years ago • 4 comments
trafficstars

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

WurstCommander avatar Jul 22 '16 07:07 WurstCommander

In windows cli, run "chcp 65001"

esquire900 avatar Jul 22 '16 09:07 esquire900

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

hrosdei avatar Jul 24 '16 23:07 hrosdei

chcp 65001 before executing the app solved it.

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

WurstCommander avatar Jul 25 '16 13:07 WurstCommander

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.

smelsworst avatar Jan 15 '17 15:01 smelsworst