The Fix
pip install pydantic==2.8.0
Based on closed pydantic/pydantic issue #9668 · PR/commit linked
@@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
$ gh repo clone pydantic/pydantic
$ cd pydantic
$ python3.13 -m venv _e
$ . _e/bin/activate
(_e) $ UNSAFE_PYO3_SKIP_VERSION_CHECK=1 pip install -e .
(_e) $ pip install cloudpickle coverage[toml] dirty-equals eval-type-backport pytest pytest-mock pytest-pretty pytest-examples faker pytest-benchmark pytest-codspeed packaging
(_e) $ python -m pytest
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==2.8.0\nWhen NOT to use: This fix should not be used if the application requires compatibility with earlier Python versions without testing.\n\n
Why This Fix Works in Production
- Trigger: - Fedora now has [Python 3.13 as the system Python](https://fedoraproject.org/wiki/Changes/Python3.13) in Rawhide, and [Fedora 41 will release with Python 3.13…
- Mechanism: Adds support for Python 3.13, addressing compatibility issues and updating CI configurations.
- Why the fix works: Adds support for Python 3.13, addressing compatibility issues and updating CI configurations. (first fixed release: 2.8.0).
Why This Breaks in Prod
- Shows up under Python 3.13 in real deployments (not just unit tests).
- Production symptom (often without a traceback): - Fedora now has [Python 3.13 as the system Python](https://fedoraproject.org/wiki/Changes/Python3.13) in Rawhide, and [Fedora 41 will release with Python 3.13 in October](https://fedorapeople.org/groups/schedule/f-41/f-41-all-tasks.html).
Proof / Evidence
- GitHub issue: #9668
- Fix PR: https://github.com/pydantic/pydantic/pull/9743
- First fixed release: 2.8.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- 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).
“Definitely something we're prioritizing. I'll pull this in once we get the new version of pyo3 into pydantic-core with 3.13 support. Hoping to have this…”
“@musicinmybrain, Thanks for opening this feature request. Support for 3.13 is definitely something we want to do explicitly soon. I'll chat with the team re…”
Failure Signature (Search String)
- - Fedora now has [Python 3.13 as the system Python](https://fedoraproject.org/wiki/Changes/Python3.13) in Rawhide, and [Fedora 41 will release with Python 3.13 in
- - Test collection errors due to the `DeprecationWarning` from https://github.com/pydantic/pydantic/issues/9613.
Copy-friendly signature
Failure Signature
-----------------
- Fedora now has [Python 3.13 as the system Python](https://fedoraproject.org/wiki/Changes/Python3.13) in Rawhide, and [Fedora 41 will release with Python 3.13 in October](https://fedorapeople.org/groups/schedule/f-41/f-41-all-tasks.html).
- Test collection errors due to the `DeprecationWarning` from https://github.com/pydantic/pydantic/issues/9613.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
- Fedora now has [Python 3.13 as the system Python](https://fedoraproject.org/wiki/Changes/Python3.13) in Rawhide, and [Fedora 41 will release with Python 3.13 in October](https://fedorapeople.org/groups/schedule/f-41/f-41-all-tasks.html).
- Test collection errors due to the `DeprecationWarning` from https://github.com/pydantic/pydantic/issues/9613.
Minimal Reproduction
$ gh repo clone pydantic/pydantic
$ cd pydantic
$ python3.13 -m venv _e
$ . _e/bin/activate
(_e) $ UNSAFE_PYO3_SKIP_VERSION_CHECK=1 pip install -e .
(_e) $ pip install cloudpickle coverage[toml] dirty-equals eval-type-backport pytest pytest-mock pytest-pretty pytest-examples faker pytest-benchmark pytest-codspeed packaging
(_e) $ python -m pytest
Environment
- Python: 3.13
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.8.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option D — Guard side-effects with OnceOnly Guardrail for side-effects
Mitigate duplicate external side-effects under retries/timeouts/agent loops by gating the operation before calling external systems.
- Place OnceOnly between your code/agent and real side-effects (Stripe, emails, CRM, APIs).
- Use a stable key per side-effect (e.g., customer_id + action + idempotency_key).
- Fail-safe: configure fail-open vs fail-closed based on blast radius and spend risk.
Show example snippet (optional)
from onceonly import OnceOnly
import os
once = OnceOnly(api_key=os.environ["ONCEONLY_API_KEY"], fail_open=True)
# Stable idempotency key per real side-effect.
# Use a request id / job id / webhook delivery id / Stripe event id, etc.
event_id = "evt_..." # replace
key = f"stripe:webhook:{event_id}"
res = once.check_lock(key=key, ttl=3600)
if res.duplicate:
return {"status": "already_processed"}
# Safe to execute the side-effect exactly once.
handle_event(event_id)
Fix reference: https://github.com/pydantic/pydantic/pull/9743
First fixed release: 2.8.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the application requires compatibility with earlier Python versions without testing.
- Do not use this to hide logic bugs or data corruption. Use it to block duplicate external side-effects and enforce tool permissions/spend caps.
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 |
|---|---|
| 2.8.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.