Modified error formatting to remove unicode character.

jsonschema's error.message returns either u' or ' in strings depending on the python version.
pull/6592/head
Cruz Monrreal II 2018-04-10 15:19:34 -05:00
parent b286838ebf
commit 85ce95d0ff
3 changed files with 4 additions and 3 deletions

View File

@ -393,7 +393,8 @@ class Config(object):
return self.format_validation_error(error.context[0], path)
else:
return "in {} element {}: {}".format(
path, str(".".join(str(p) for p in error.absolute_path)), error.message)
path, ".".join(p for p in error.absolute_path),
error.message.replace('u\'','\''))
def __init__(self, tgt, top_level_dirs=None, app_config=None):
"""Construct a mbed configuration

View File

@ -1,5 +1,5 @@
{
"K64F": {
"exception_msg": "Additional properties are not allowed (u'unknown_key' was unexpected)"
"exception_msg": "Additional properties are not allowed ('unknown_key' was unexpected)"
}
}

View File

@ -1,5 +1,5 @@
{
"K64F": {
"exception_msg": "Additional properties are not allowed (u'unknown_key' was unexpected)"
"exception_msg": "Additional properties are not allowed ('unknown_key' was unexpected)"
}
}