Skip to content
Snippets Groups Projects
Commit 72c6240a authored by Cesar Mena's avatar Cesar Mena
Browse files

encoding: protect against non-ascii default encoding

If the default python encoding was changed from ascii, the attempt to
encode as ascii before lower() could throw a UnicodeEncodeError.
Catch UnicodeError instead to prevent an unhandled exception.
parent 774e2dcd
No related branches found
No related tags found
No related merge requests found
......@@ -169,7 +169,7 @@
"best-effort encoding-aware case-folding of local string s"
try:
return s.encode('ascii').lower()
except UnicodeDecodeError:
except UnicodeError:
pass
try:
if isinstance(s, localstr):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment