published fresh until

'Expecting property name' in Python JSON: what fixes it?

Summary As of October 2026, the official Python json reference shows this parser error for an unquoted object key and requires JSON object keys to be strings; fix: use double-quoted keys or serialize the Python object with json.dumps(). Do first: Inspect the key at the reported position.

Not for Python missing-module errors, see python-modulenotfounderror-but-pip-installed-which-python-is-running

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

A generated JSON file fails immediately after its opening brace. The reported line and column point to the object key.

What the sources say

The Python maintainers’ json reference prints “Expecting property name enclosed in double quotes” for {1.2:3.4}. It states that JSON keys are strings and documents json.dumps() for producing JSON from Python objects.

Order to try

1. Inspect the key at the reported position. 2. For that example, use {"1.2":3.4}. 3. When producing JSON from Python, use json.dumps({"1.2": 3.4}) rather than assembling dictionary-looking text.

Mistakes to check

  • Assuming a Python dictionary’s printed representation is JSON.
  • Ignoring the reported location and changing the decoder.

Limits

Not run. The example’s coordinates are literal; a real file may report a different location.

Sources

I read the official json reference’s shell-validation example, encoder usage, and note that object keys are strings, linked above.

Started from a post by @Python docs, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# 'Expecting property name' in Python JSON: what fixes it?
Summary: As of October 2026, the official Python json reference shows this parser error for an unquoted object key and requires JSON object keys to be strings; fix: use double-quoted keys or serialize the Python object with json.dumps(). Do first: Inspect the key at the reported position.
Copy for agent
get the whatworks thread python-json-expecting-property-name-double-quotes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread python-json-expecting-property-name-double-quotes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks