Jump to solution
Verify

The Fix

pip install pydantic==1.10.15

Based on closed pydantic/pydantic issue #9019 · 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
@@ -1067,9 +1067,26 @@ class StaticFoobarModel(BaseModel): Here `StaticFoobarModel` and `DynamicFoobarModel` are identical. -Fields are defined by a tuple of the form `(<type>, <default value>)`. The special keyword -arguments `__config__` and `__base__` can be used to customise the new model. This includes -extending a base model with extra fields.
repro.py
from pydantic.v1 import BaseModel as BaseModelV1 from pydantic import BaseModel as BaseModelV2 class MessageV1(BaseModelV1): test: str class MessageV2(BaseModelV2): test: str message_v1 = MessageV1(test="¿Cómo estás?") message_v2 = MessageV2(test="¿Cómo estás?") print("V1", message_v1.json()) print("V2", message_v2.model_dump_json())
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 backward compatibility with V1's JSON output is required.\n\nOption C — Workaround\nin the meantime: https://github.com/pydantic/pydantic/issues/8825.\nWhen NOT to use: This fix should not be used if backward compatibility with V1's JSON output is required.\n\n

Why This Fix Works in Production

  • Trigger: When I read V2 migration guide, I did not expect major changes to how `model_dump_json` will work compared to V1's `json`. However, it seems like there's a…
  • Mechanism: The change in JSON serialization behavior between Pydantic V1 and V2 affects non-ASCII character handling
  • Why the fix works: Updates the documentation to address the differences in JSON serialization between Pydantic V1 and V2, specifically regarding the handling of non-ASCII characters. (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.8 in real deployments (not just unit tests).
  • The change in JSON serialization behavior between Pydantic V1 and V2 affects non-ASCII character handling
  • Production symptom (often without a traceback): When I read V2 migration guide, I did not expect major changes to how `model_dump_json` will work compared to V1's `json`. However, it seems like there's a difference in how the new method handles non-ASCII characters.

Proof / Evidence

Discussion

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

“I've also marked this with a documentation tag, and will open a PR later this week to update the migration guide with a note on…”
@sydney-runkle · 2024-03-15 · source
“@pkontis, You can use model_dump(mode='json') to make this work!”
@sydney-runkle · 2024-03-18 · source
“@pkotnis, Thanks for reporting this! Indeed, this is a V1 -> V2 change that hasn't yet been well documented”
@sydney-runkle · 2024-03-15 · source
“@sydney-runkle , thanks for the update”
@pkotnis · 2024-03-18 · source

Failure Signature (Search String)

  • When I read V2 migration guide, I did not expect major changes to how `model_dump_json` will work compared to V1's `json`. However, it seems like there's a difference in how the
Copy-friendly signature
signature.txt
Failure Signature ----------------- When I read V2 migration guide, I did not expect major changes to how `model_dump_json` will work compared to V1's `json`. However, it seems like there's a difference in how the new method handles non-ASCII characters. python version: 3.8.17 (default, Nov 6 2023, 20:47:47) [Clang 15.0.0 (clang-1500.0.40.1)]

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- When I read V2 migration guide, I did not expect major changes to how `model_dump_json` will work compared to V1's `json`. However, it seems like there's a difference in how the new method handles non-ASCII characters. python version: 3.8.17 (default, Nov 6 2023, 20:47:47) [Clang 15.0.0 (clang-1500.0.40.1)]

Minimal Reproduction

repro.py
from pydantic.v1 import BaseModel as BaseModelV1 from pydantic import BaseModel as BaseModelV2 class MessageV1(BaseModelV1): test: str class MessageV2(BaseModelV2): test: str message_v1 = MessageV1(test="¿Cómo estás?") message_v2 = MessageV2(test="¿Cómo estás?") print("V1", message_v1.json()) print("V2", message_v2.model_dump_json())

Environment

  • Python: 3.8
  • Pydantic: 2

What Broke

Users experience unexpected JSON output differences when migrating from V1 to V2.

Why It Broke

The change in JSON serialization behavior between Pydantic V1 and V2 affects non-ASCII character handling

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 backward compatibility with V1's JSON output is required.

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

Option C — Workaround Temporary workaround

in the meantime: https://github.com/pydantic/pydantic/issues/8825.

When NOT to use: This fix should not be used if backward compatibility with V1's JSON output is required.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

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

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 backward compatibility with V1's JSON output is required.

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.