The Fix
pip install pydantic==1.10.1
Based on closed pydantic/pydantic issue #8570 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -7,5 +7,5 @@ pyflakes==1.6.0
pytest-cov==2.5.1
pytest-isort==0.1.0
-pytest-mock==1.6.2
+pytest-mock==1.6.3
pytest-sugar==0.9.0
from pydantic import BaseModel, FutureDatetime
class Model(BaseModel):
dt: FutureDatetime
m = Model(dt="1500-01-01T00:00:00+00:00")
print(m.model_dump())
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install pydantic==1.10.1\nWhen NOT to use: This fix should not be applied if the application requires support for historical dates.\n\n
Why This Fix Works in Production
- Trigger: attempt to subtract with overflow
- Mechanism: FutureDatetime incorrectly accepts years between 1000 and 1599 due to validation logic
- Why the fix works: The issue with FutureDatetime accepting years between 1000 and 1599 is acknowledged, and a fix is expected to be implemented in the speedate library. (first fixed release: 1.10.1).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 3.12 in real deployments (not just unit tests).
- FutureDatetime incorrectly accepts years between 1000 and 1599 due to validation logic
- Surfaces as: thread '<unnamed>' panicked at /Users/programming/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speedate-0.13.0/src/date.rs:219:20:
Proof / Evidence
- GitHub issue: #8570
- Fix PR: https://github.com/pydantic/speedate/pull/77
- First fixed release: 1.10.1
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.58
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“@sydney-runkle I would like to work on this! Can you please assign this to me ?”
“@Zer0x00, Indeed looks like a bug. PRs welcome with a fix! Thanks for reporting this. My hunch is that this might be a fix for…”
“Ah yes, the fix will be in speedate, see this error:”
“@StrawHatDrag0n, I think the fix to be implemented here is that we shouldn't have a Panic Exception, but rather an informative error that dates prior…”
Failure Signature (Search String)
- attempt to subtract with overflow
Error Message
Stack trace
Error Message
-------------
thread '<unnamed>' panicked at /Users/programming/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speedate-0.13.0/src/date.rs:219:20:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
File "/Users/programming/pydantic_work/pydantic/test.py", line 8, in <module>
m = Model(dt="1500-01-01T00:00:00+00:00")
File "/Users/programming/pydantic_work/pydantic/pydantic/main.py", line 171, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pyo3_runtime.PanicException: attempt to subtract with overflow
Minimal Reproduction
from pydantic import BaseModel, FutureDatetime
class Model(BaseModel):
dt: FutureDatetime
m = Model(dt="1500-01-01T00:00:00+00:00")
print(m.model_dump())
Environment
- Python: 3.12
- Pydantic: 2
What Broke
Users can create FutureDatetime instances with invalid historical dates, leading to unexpected behavior.
Why It Broke
FutureDatetime incorrectly accepts years between 1000 and 1599 due to validation logic
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.1
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pydantic/speedate/pull/77
First fixed release: 1.10.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the application requires support for historical dates.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.10.1 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.