Minor patch related to the #2856

This commit is contained in:
Miroslav Stampar
2017-12-30 16:35:45 +01:00
parent 132fb0d18d
commit 6e9fe27fa0
3 changed files with 4 additions and 4 deletions

View File

@@ -475,7 +475,7 @@ def getValue(expression, blind=True, union=True, error=True, time=True, fromUser
# Dirty patch (safe-encoded unicode characters)
if isinstance(value, unicode) and "\\x" in value:
try:
candidate = eval(repr(value).replace("\\\\x", "\\x").replace("u'", "'", 1)).decode(UNICODE_ENCODING)
candidate = eval(repr(value).replace("\\\\x", "\\x").replace("u'", "'", 1)).decode(conf.encoding or UNICODE_ENCODING)
if "\\x" not in candidate:
value = candidate
except: