GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JSON does not preserve the order of OrderedDict · Issue #100272 · python/cpython

JSON does not preserve the order of OrderedDict #100272

New issue
Copy link
New issue
Copy link
Closed
Closed
JSON does not preserve the order of OrderedDict#100272
Copy link
Labels
3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@serhiy-storchaka
serhiy-storchaka
opened on Dec 15, 2022
Issue body actions

#95385 caused a regression in JSON serialization of OrderedDict when use the C implementation.

>>> import collections, json
>>> od = collections.OrderedDict(a=1, b=2)
>>> od.move_to_end('a')
>>> od
OrderedDict([('b', 2), ('a', 1)])
>>> json.dumps(od)
'{"a": 1, "b": 2}'

With the pure Python implementation, as well as in older Pythons, you get '{"b": 2, "a": 1}'.

Linked PRs

  • gh-100272: Fix JSON serialization of OrderedDict #100273

Activity

  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.12only security fixesonly security fixes
    on Dec 15, 2022
  2. serhiy-storchaka
    added this to JSON issueson Dec 15, 2022
  3. serhiy-storchaka
    added 2 commits that reference this issue on Dec 15, 2022

    pythongh-100272: Fix JSON serialization of OrderedDict

    3262ea6

    gh-100272: Fix JSON serialization of OrderedDict (GH-100273)

    0fe61d0
  4. serhiy-storchaka
    closed this as completedon Dec 17, 2022
  5. serhiy-storchaka
    moved this to Done in JSON issueson Dec 17, 2022
  6. shihai1991
    added a commit that references this issue on Dec 18, 2022

    Merge remote-tracking branch 'origin/main' into bpo_34697

    2878571
  7. carljm
    added a commit that references this issue on Dec 19, 2022

    Merge branch 'main' into fastmock

    a9af20a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • JSON issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.