You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it is assumed that the base64 encoded value can be represented as utf-8 string. As a result InvalidSchemaFormatValue is raised when unmarshalling binary data which can't be represented as utf-8 string, e.g. the value base64.b64encode(b'\xff').
The exception text is: Failed to format value /w== to format byte: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte.
The text was updated successfully, but these errors were encountered:
IMO this was introduced with the fix for #117. I don't know the intention of the fix, why byte should be text type, but the way it's implemented fails with non unicode characters. I see two possible solutions, that are working for me:
Get back to the way byte was handled before #117, by just trying if the value can be base64 decoded:
It's also possible to make a more intelligent check instead of lambda x: True, if you care about which exception you get from validation, but I think this still is enough to make sure that the value is valid.
When validating a property of type
it is assumed that the base64 encoded value can be represented as utf-8 string. As a result
InvalidSchemaFormatValue
is raised when unmarshalling binary data which can't be represented as utf-8 string, e.g. the valuebase64.b64encode(b'\xff')
.The exception text is:
Failed to format value /w== to format byte: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
.The text was updated successfully, but these errors were encountered: