summaryrefslogtreecommitdiff
path: root/python/ovs/json.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/ovs/json.py')
-rw-r--r--python/ovs/json.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/ovs/json.py b/python/ovs/json.py
index f8b02d180..67470fcbc 100644
--- a/python/ovs/json.py
+++ b/python/ovs/json.py
@@ -113,7 +113,8 @@ def from_string(s):
try:
s = unicode(s, 'utf-8')
except UnicodeDecodeError, e:
- seq = ' '.join(["0x%2x" % ord(c) for c in e.object[e.start:e.end]])
+ seq = ' '.join(["0x%2x" % ord(c)
+ for c in e.object[e.start:e.end] if ord(c) >= 0x80])
return ("not a valid UTF-8 string: invalid UTF-8 sequence %s" % seq)
p = Parser(check_trailer=True)
p.feed(s)