The Fix
pip install pydantic==1.10.1
Based on closed pydantic/pydantic issue #9248 · 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%.
@@ -34,7 +34,7 @@ A few notes:
Type coercion like this can be extremely helpful but also confusing or not desired,
-see [below](#coercion-and-stictness) for a discussion of `validate_arguments`'s limitations in this regard.
+see [below](#coercion-and-strictness) for a discussion of `validate_arguments`'s limitations in this regard.
from enum import Enum
from pydantic import TypeAdapter
class Animal(Enum):
CAT = "cat", "meow"
DOG = "dog", "woof"
def __new__(cls, species: str, sound: str):
obj = object.__new__(cls)
obj._value_ = species
obj._all_values = (species, sound)
obj.species = species
obj.sound = sound
cls._value2member_map_[sound] = obj
return obj
print(Animal("cat"))
print(Animal("meow"))
print(TypeAdapter(Animal).validate_python("meow"))
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: Do not apply this fix if the Enum does not use a custom __new__ method.\n\n
Why This Fix Works in Production
- Trigger: New Enum validation doesn't work for custom __new__ methods
- Mechanism: The new Enum validation in Pydantic fails for enums with custom __new__ methods
- Why the fix works: Addresses the issue with Enum validation for custom __new__ methods in Pydantic by ensuring compatibility. (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.10 in real deployments (not just unit tests).
- The new Enum validation in Pydantic fails for enums with custom __new__ methods
- Production symptom (often without a traceback): New Enum validation doesn't work for custom __new__ methods
Proof / Evidence
- GitHub issue: #9248
- Fix PR: https://github.com/pydantic/pydantic-core/pull/1456
- First fixed release: 1.10.1
- 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.52
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Makes sense, happy to accept a pr to pydantic-core to detect custom __new__ methods and call them if that's possible. Btw, we already support the…”
Failure Signature (Search String)
- New Enum validation doesn't work for custom __new__ methods
- The newly release improvements to the `Enum` class break enums with a custom `__new__` implementation.
Copy-friendly signature
Failure Signature
-----------------
New Enum validation doesn't work for custom __new__ methods
The newly release improvements to the `Enum` class break enums with a custom `__new__` implementation.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
New Enum validation doesn't work for custom __new__ methods
The newly release improvements to the `Enum` class break enums with a custom `__new__` implementation.
Minimal Reproduction
from enum import Enum
from pydantic import TypeAdapter
class Animal(Enum):
CAT = "cat", "meow"
DOG = "dog", "woof"
def __new__(cls, species: str, sound: str):
obj = object.__new__(cls)
obj._value_ = species
obj._all_values = (species, sound)
obj.species = species
obj.sound = sound
cls._value2member_map_[sound] = obj
return obj
print(Animal("cat"))
print(Animal("meow"))
print(TypeAdapter(Animal).validate_python("meow"))
Environment
- Python: 3.10
- Pydantic: 2
What Broke
Users experience validation errors when using custom Enum classes.
Why It Broke
The new Enum validation in Pydantic fails for enums with custom __new__ methods
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/pydantic-core/pull/1456
First fixed release: 1.10.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if the Enum does not use a custom __new__ method.
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.