Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stefankoegl/python-json-patch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.47
Choose a base ref
...
head repository: stefankoegl/python-json-patch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.48
Choose a head ref
  • 15 commits
  • 4 files changed
  • 5 contributors

Commits on Nov 11, 2026

  1. Let jsonpatch --backup replace an existing backup

    'jsonpatch -i -b' failed with a FileExistsError if ORIGINAL.orig existed,
    so the second run on a file failed. The fallback that is used if no
    temporary file can be created replaced the backup on POSIX, but failed on
    Windows, where rename() does not overwrite.
    
    Both now replace an older backup. An older backup is kept if creating the
    new one fails.
    
    Co-Authored-By: Claude Fable 5.2 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01PewzpjVeke4LTQ7Q88nyu6
    claude committed Nov 11, 2026
    Configuration menu
    Copy the full SHA
    bc88e9b View commit details
    Browse the repository at this point in the history
  2. Report errors of jsondiff and jsonpatch in one line

    A patch that could not be applied, an invalid patch, invalid JSON and
    errors reading or writing files ended the programs with a traceback. They
    now print 'PROGRAM: error: MESSAGE' to stderr and exit with status 2, as
    they already do for wrong arguments and files that can't be opened.
    Messages for invalid JSON and invalid UTF-8 name the file.
    
    Status 2 keeps errors apart from status 1, with which jsondiff reports
    that the files differ. Other exceptions, which would be bugs, still show
    a traceback.
    
    Co-Authored-By: Claude Fable 5.2 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01PewzpjVeke4LTQ7Q88nyu6
    claude committed Nov 11, 2026
    Configuration menu
    Copy the full SHA
    4c0fbfb View commit details
    Browse the repository at this point in the history
  3. Serialize and compare patches whose paths are pointer objects

    The 'path' and 'from' of an operation can be given as pointer objects
    instead of strings. A JsonPatch created from such operations could be
    applied, but to_string() raised a TypeError, as its operations still
    contained the pointer objects, and it was not equal to the same patch
    given the paths as strings.
    
    JsonPatch now replaces pointer objects by their paths in its operations,
    in copies, so the operations it was created from are unchanged. Patch
    operations compare and hash by the paths as well. Their setters keep
    updating the operation they were created from.
    
    Co-Authored-By: Claude Fable 5.2 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01PewzpjVeke4LTQ7Q88nyu6
    claude committed Nov 11, 2026
    Configuration menu
    Copy the full SHA
    42c8410 View commit details
    Browse the repository at this point in the history
  4. Reject diffs that change a member whose name is not a string

    The diff turned object keys that are not strings into strings for the
    paths of its operations. A path can only refer to members whose names
    are strings, though: '/1' is the member '1', not the member 1. So
    make_patch({1: 'a'}, {1: 'b'}) returned a patch that failed on its own
    source, make_patch({1: 'a'}, {1: 'a', 2: 'b'}) one that added a member
    '2' instead of 2, and make_patch({1: 'a'}, {'1': 'a'}) an empty one.
    
    Creating a patch now raises a TypeError if one of its operations would
    have to refer to such a member. Documents with such members can still be
    compared as long as these members are equal, or are part of a value that
    is added, removed or moved as a whole, as those patches are correct.
    
    Co-Authored-By: Claude Fable 5.2 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01PewzpjVeke4LTQ7Q88nyu6
    claude committed Nov 11, 2026
    Configuration menu
    Copy the full SHA
    7e99716 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2026

  1. Configuration menu
    Copy the full SHA
    b1f84c9 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2026

  1. Improve backup handling in jsonpatch_cli.py

    Handle file replacement and unlinking for backups.
    
    Co-authored-by: Copilot Autofix powered by AI <[email protected]>
    stefankoegl and Copilot authored Nov 16, 2026
    Configuration menu
    Copy the full SHA
    09f0fc6 View commit details
    Browse the repository at this point in the history
  2. from_diff: normalize non-JSON containers for move keys, copy dict keys

    The cached sort_keys encoder cannot serialize UserDict and UserList
    values, so equal but independently allocated values got different move
    keys, a move became remove plus add, and to_string() then failed to
    serialize the added value. Fall back to the generic _sorted_members
    path for values the encoder rejects; it normalizes those containers the
    same way the code did before the encoder was cached.
    
    _json_copy also reused the dictionary keys instead of copying them.
    Copy them through the same memo as the values, like copy.deepcopy does,
    so that a key that is also a value stays one object and a str subclass
    used as a key is not aliased with the input document.
    
    Adds a regression test for each case.
    linluozi committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    55eb7c5 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2026

  1. test: compare Unicode string values exactly

    Signed-off-by: Mohamed Ajab <[email protected]>
    Mohamedajab committed Nov 19, 2026
    Configuration menu
    Copy the full SHA
    5ea6266 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5f5cbda View commit details
    Browse the repository at this point in the history
  3. Merge pull request #272 from stefankoegl/claude/pointer-object-paths

    Serialize and compare patches whose paths are pointer objects
    stefankoegl authored Nov 19, 2026
    Configuration menu
    Copy the full SHA
    1ebce1e View commit details
    Browse the repository at this point in the history
  4. Merge pull request #271 from stefankoegl/claude/cli-error-messages

    Report errors of jsondiff and jsonpatch in one line
    stefankoegl authored Nov 19, 2026
    Configuration menu
    Copy the full SHA
    34a7586 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #270 from stefankoegl/claude/cli-backup-overwrite

    Let jsonpatch --backup replace an existing backup
    stefankoegl authored Nov 19, 2026
    Configuration menu
    Copy the full SHA
    b88cd76 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #273 from stefankoegl/claude/make-patch-non-string…

    …-keys
    
    Reject diffs that change a member whose name is not a string
    stefankoegl authored Nov 19, 2026
    Configuration menu
    Copy the full SHA
    f9714ae View commit details
    Browse the repository at this point in the history
  7. Merge pull request #274 from linluozi/from-diff-copy-fastpath

    from_diff: avoid the generic deepcopy and the sorted copy for move keys
    stefankoegl authored Nov 19, 2026
    Configuration menu
    Copy the full SHA
    84a64f5 View commit details
    Browse the repository at this point in the history
  8. bump version to 1.48

    stefankoegl committed Nov 19, 2026
    Configuration menu
    Copy the full SHA
    ff82daa View commit details
    Browse the repository at this point in the history
Loading