New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception parsing negative integer strings #9396
Comments
I investigated this and the issue seems to be in strip_leading_zeros function where if any character occurs except (+, _, 1 ... 9) in the string then None is being returned. The https://github.com/pydantic/pydantic-core/blob/main/src/input/shared.rs#L149-L168 |
Hey folks, Thanks for reporting this bug. Definitely something we want to fix in 2.7.2. Should be an easy fix if anyone is interested in contributing to |
I'll pick it up. |
Initial Checks
Description
Starting with pydantic 2.7.1 parsing an integer string like
'-1.0'
gives an error while'1.0'
works fine. Probably related to pydantic/pydantic-core#1269 or pydantic/pydantic-core#1272.Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: