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
I think when allowing partial JSON, and parsing from bytes, we shouldn't get errors if the trailing characters are not valid unicode.
Example demonstrating misbehavior:
frompydantic_coreimportSchemaValidator, core_schemamy_partial_string='"abc€'# works fine if you replace with = '"abc€d'non_unicode_partial_string_bytes=my_partial_string.encode()[:-1]
SchemaValidator(core_schema.any_schema()).validate_json(non_unicode_partial_string_bytes, allow_partial='trailing-strings')
"""pydantic_core._pydantic_core.ValidationError: 1 validation error for any Invalid JSON: invalid unicode code point at line 1 column 6 [type=json_invalid, input_value=b'"abc\xe2\x82', input_type=bytes] For further information visit https://errors.pydantic.dev/2.10/v/json_invalid"""
The text was updated successfully, but these errors were encountered:
I think when allowing partial JSON, and parsing from bytes, we shouldn't get errors if the trailing characters are not valid unicode.
Example demonstrating misbehavior:
The text was updated successfully, but these errors were encountered: