Jump to solution
Details

The Fix

pip install pydantic==1.10.15

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

Open PR/Commit
@@ -64,7 +64,7 @@ class _FromFieldInfoInputs(typing_extensions.TypedDict, total=False): min_length: int | None max_length: int | None - pattern: str | None + pattern: str | typing.Pattern[str] | None allow_inf_nan: bool | None
fix.md
Option A — Upgrade to fixed release\npip install pydantic==1.10.15\nWhen NOT to use: This fix should not be used if the application relies on string patterns only.\n\n

Why This Fix Works in Production

  • Trigger: - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
  • Mechanism: The pattern field in Pydantic's Field did not support compiled regular expressions
  • Why the fix works: Adds support for using compiled regular expressions in the pattern field of Pydantic's Field. (first fixed release: 1.10.15).

Why This Breaks in Prod

  • The pattern field in Pydantic's Field did not support compiled regular expressions
  • Production symptom (often without a traceback): - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“@jag-k, Great, thanks! I've reviewed your PR. Looks good to go, once you add some tests!”
@sydney-runkle · 2024-03-22 · source

Failure Signature (Search String)

  • - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
  • - [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)
Copy-friendly signature
signature.txt
Failure Signature ----------------- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/) - [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/) - [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)

What Broke

Users could not use compiled regex patterns directly in Field definitions, leading to validation issues.

Why It Broke

The pattern field in Pydantic's Field did not support compiled regular expressions

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==1.10.15

When NOT to use: This fix should not be used if the application relies on string patterns only.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

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

First fixed release: 1.10.15

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 relies on string patterns only.

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
1.10.15 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.