-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Fix] decode error(#1806) #1809
Conversation
someone test and comment please |
Not working for me.
As soon as I make |
I am running it myself and it works |
The fix that works for me is:
@mingchuno Fell free the use the fix above in your PR if you see fit. |
@mingchuno It's the same problem, the Unicode exception is probably getting caught by a generic except that just says unable to login. It's probably because my first name as a special character 😉 |
@vieira We should solve it in lower layer since the logger is shared by the whole app. |
@mingchuno Yes, I agree but in that case you have the fix every call to the logger that are already passing utf-8 encoded strings. Forget about my first name, it's probably the initial location. |
@vieira Well, I am not actually know much on Python. |
it works for me fine, thx! But Instead of Cyrillic title i got in terminal pokestot name with wrong encoding anyway (before it also was with not-cyrilic encoding, just another one) :) |
@mingchuno You encode a sequence of unicode characters into a str, e.g. print(u'ç'.encode('utf-8')). u'ç'.decode('utf-8') won't work. You use decode, for instance, to bring a some encoded str back to unicode, you have to know how the str was encoded and decode it with the same codec, e.g. 'utf-8'. I am no expert in this, either. |
@mingchuno Can you reproduce my problem if you set your initial location to something with special chars, e.g. "ç" or "ü"? |
@mingchuno Without changing anything else, I think this works:
Sometimes log is called with an already decoded str, other with an unicode sequence. If it is already a string decode will fail but it is safe to continue. |
@vieira your fix seems to do it for me: (I used to have an error due to the "ü" in Sihlbrücke) [12:31:10] PokeStop on cooldown. Time left: 4 minutes, 59 seconds Edit: Apparently somethng's still wrong: (Why do we use ascii???) Traceback (most recent call last): Edit2: I put @CapCap 's fix in too and now it works. I believe nowhere should we still use ascii. |
@sgitkene Ooops, missed an u'' in line 28. I will open a PR with both fixes. Should be working now (Now at Pokestop: Quiosque Cais do Sodré):
|
Please approve |
190640f fixed this |
sorry @vieira I was away. I assume it is no longer needed? |
@vieira I've come up against a couple more I've done this with |
The logger has been deprecated and replaced with websockets. Hopefully this isn't an issue anymore. If it is, please re-open against the new approach. |
Short Description:
[Fix] decode error(#1806)
Fixes: