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
This seems to be a regression as v.2.6.4 was not affected by this problem.
Basically if you define a model with an integer field and fill it with string "00", you get the following error message:
pydantic_core._pydantic_core.ValidationError: 1 validation error for MyModel
id
Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='00', input_type=str]
For further information visit https://errors.pydantic.dev/2.7/v/int_parsing
The problem seems only to happen with multiple zeros (i.e. "00", "000", ...), other numeric strings work properly (e.g. "01", "0").
Thanks for reporting this. @samuelcolvin, could you please take a look? I think this is likely related to the int parsing changes you worked on recently...
Initial Checks
Description
This seems to be a regression as v.2.6.4 was not affected by this problem.
Basically if you define a model with an integer field and fill it with string "00", you get the following error message:
The problem seems only to happen with multiple zeros (i.e. "00", "000", ...), other numeric strings work properly (e.g. "01", "0").
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: