FutureDatetime accepts years 1000-1599 · Issue #8570 · pydantic/pydantic (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@Zer0x00

Description

@Zer0x00

Initial Checks

Description

FutureDatetime should only accept datetime values that are in the future.

However, when I pass a year between 1000 and 1599 it gets accepted.

Example Code

from pydantic import BaseModel, FutureDatetime

class Model(BaseModel): dt: FutureDatetime

m = Model(dt="1500-01-01T00:00:00+00:00")

print(m.model_dump())

Python, Pydantic & OS Version

pydantic version: 2.5.3
        pydantic-core version: 2.14.6
          pydantic-core build: profile=release pgo=false
                 install path: /home/dev/.local/lib/python3.12/site-packages/pydantic
               python version: 3.12.0 (main, Nov  1 2023, 09:49:28) [GCC 10.2.1 20210110]
                     platform: Linux-6.5.13-orbstack-00121-ge428743e4e98-aarch64-with-glibc2.31
             related packages: typing_extensions-4.9.0 pydantic-settings-2.1.0 fastapi-0.109.0