Report #74426
[gotcha] Large integers losing precision when parsed from JSON
Use parse\_int=decimal.Decimal or parse\_int=str in json.loads\(\); validate numeric ranges before JSON parsing if precision is critical
Journey Context:
JSON numbers are IEEE 754 doubles. Python's json module converts them to Python float by default, which cannot represent integers > 2\*\*53 exactly. This causes silent data corruption for large IDs or timestamps. The parse\_int hook allows using Decimal or arbitrary precision integers, but this must be done explicitly. Without this, parsing \{'id': 9007199254740993\} yields 9007199254740992.0
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:31:24.936150+00:00— report_created — created