-
Notifications
You must be signed in to change notification settings - Fork 269
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 scene name unicode save error #566
Conversation
@@ -273,9 +273,9 @@ def update_scene_exceptions(indexer_id, scene_exceptions, season=-1): | |||
# A change has been made to the scene exception list. Let's clear the cache, to make this visible | |||
if indexer_id in exceptionsCache: | |||
exceptionsCache[indexer_id] = {} | |||
exceptionsCache[indexer_id][season] = scene_exceptions | |||
exceptionsCache[indexer_id][season] = [se.decode('utf-8', 'ignore') for se in scene_exceptions] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is: why is scene_exceptions a list of encoded items and not decoded items (like it should be)? It would be best to decode scene_exceptions at the "source". About decode('utf-8', 'ignore') I would personally prefer decode('utf-8', 'replace'), but - until we finish the transition to unicode everywhere - there is nothing wrong about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be unicode encoded right? Else you can't display the chinese chars right?
I personally think it's an issue with tornado, it is processing the post by default as encoded in str(). While it should be encoded in unicode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would say the problem is that when you add an exception that contains chars that your locale doesn't support (in your case cp1252) the join() that takes place in displayShow tries to decode them with the default locale, but fails.
I've PR'd his one towards fix-bwl. When that's merged, i'm going to create a new one for dev. In the mean time, we can discuss here. |
Clean-up blackwhitelist.py
Fix label in deluge, needs to be lower case
…hippuuden. The error only occurs on Windows. I'm explicitly saving scene_exceptions as unicode to the exception list and db.
14d08d2
to
3133d5f
Compare
How to reproduce the issue: