Python JSON parser: Ignore invalid enum string values if ignore_unknown_fields is set (#15887)
# Motivation This PR fixes failing conformance tests for python with name `IgnoreUnknownEnumStringValue`. The JSON parsing spec was discussed in https://github.com/protocolbuffers/protobuf/issues/7392. Recent equivalent changes for other languages: * Swift: https://github.com/apple/swift-protobuf/pull/1345 * C#: https://github.com/protocolbuffers/protobuf/pull/15758 # Changes - 1st commit is a noop refactoring to make relevant _ConvertScalarFieldValue invocations localized - 2nd commit introduces the child exception of `ParseError` named `EnumStringValueParseError` which is suppressed if `ignore_unknown_fields` is set - 3rd commit updates the conformance test failure lists Closes #15887 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15887 from noom:anton/7392/fix-python-test fbcc93a232a8e7c858b7cb62c1eaef1c6a54fe20 PiperOrigin-RevId: 619288323
A
Anton Grbin committed
86abf35ef5ee5b1004ec11bebb36d84c2ef6645e
Parent: 7e033c0
Committed by Copybara-Service <copybara-worker@google.com>
on 3/26/2024, 8:22:12 PM