Jump to solution
Verify

The Fix

pip install pydantic==1.10.15

Based on closed pydantic/pydantic issue #9070 · 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%.

Jump to Verify Open PR/Commit
@@ -764,7 +764,7 @@ def __getattr__(self, item: str) -> Any: pydantic_extra = None - if pydantic_extra is not None: + if pydantic_extra: try:
repro.py
from pydantic import BaseModel, ConfigDict class MyModel(BaseModel): @property def my_property(self): """A random property.""" raise AttributeError("Original Error!") model_config = ConfigDict(extra="allow") my_model = MyModel() my_model.my_property
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==1.10.15\nWhen NOT to use: This fix should not be used if the model requires strict attribute handling without allowing extra fields.\n\n

Why This Fix Works in Production

  • Trigger: Unexpected error message while using properties with pydantic models
  • Mechanism: Fixes an issue in Model.__getattr__() that incorrectly handles extra fields when they are empty, leading to misleading AttributeError messages.
  • Why the fix works: Fixes an issue in Model.__getattr__() that incorrectly handles extra fields when they are empty, leading to misleading AttributeError messages. (first fixed release: 1.10.15).
Production impact:
  • 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.9 in real deployments (not just unit tests).
  • Production symptom (often without a traceback): Unexpected error message while using properties with pydantic models

Proof / Evidence

Discussion

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

“@bcdurak, Huh, that's odd! Thanks for reporting. Definitely a bug. Happens when you have the computed_field decorator over said property as well, which is even…”
@sydney-runkle · 2024-03-22 · source
“@sydney-runkle I looked into this and it seems that the problem is in the Model.__getattr__() method”
@NeevCohen · 2024-03-22 · source

Failure Signature (Search String)

  • Unexpected error message while using properties with pydantic models
  • I ran into an issue while using a property with a pydantic class which led to an unexpected error.
Copy-friendly signature
signature.txt
Failure Signature ----------------- Unexpected error message while using properties with pydantic models I ran into an issue while using a property with a pydantic class which led to an unexpected error.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Unexpected error message while using properties with pydantic models I ran into an issue while using a property with a pydantic class which led to an unexpected error.

Minimal Reproduction

repro.py
from pydantic import BaseModel, ConfigDict class MyModel(BaseModel): @property def my_property(self): """A random property.""" raise AttributeError("Original Error!") model_config = ConfigDict(extra="allow") my_model = MyModel() my_model.my_property

Environment

  • Python: 3.9
  • Pydantic: 2

What Broke

Users receive misleading AttributeError messages when accessing properties in Pydantic models.

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 model requires strict attribute handling without allowing extra fields.

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/9082

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 model requires strict attribute handling without allowing extra fields.

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