Jump to solution
Verify

The Fix

pip install pydantic==2.8.0

Based on closed pydantic/pydantic issue #9668 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -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:
repro.py
$ 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
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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

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…”
@sydney-runkle · 2024-06-18 · source
“@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…”
@sydney-runkle · 2024-06-17 · source

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
signature.txt
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.txt
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

repro.py
$ 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

When NOT to use: This fix should not be used if the application requires compatibility with earlier Python versions without testing.

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)
onceonly.py
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)

See OnceOnly SDK

When NOT to use: 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.

Fix reference: https://github.com/pydantic/pydantic/pull/9743

First fixed release: 2.8.0

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

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

verify
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

VersionStatus
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.