The Fix
pip install pydantic==1.10.15
Based on closed pydantic/pydantic issue #9052 · PR/commit linked
@@ -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
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
- GitHub issue: #9052
- Fix PR: https://github.com/pydantic/pydantic/pull/9053
- First fixed release: 1.10.15
- 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.70
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!”
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
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 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
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.
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
| Version | Status |
|---|---|
| 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.