Repository navigation
Comparing changes
Open a pull request
base repository: stefankoegl/python-json-patch
base: v1.47
head repository: stefankoegl/python-json-patch
compare: v1.48
- 15 commits
- 4 files changed
- 5 contributors
Commits on Nov 11, 2026
-
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
Configuration menu - View commit details
-
Copy full SHA for bc88e9b - Browse repository at this point
Copy the full SHA bc88e9bView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 4c0fbfb - Browse repository at this point
Copy the full SHA 4c0fbfbView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 42c8410 - Browse repository at this point
Copy the full SHA 42c8410View commit details -
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_01PewzpjVeke4LTQ7Q88nyu6Configuration menu - View commit details
-
Copy full SHA for 7e99716 - Browse repository at this point
Copy the full SHA 7e99716View commit details
Commits on Nov 13, 2026
-
Configuration menu - View commit details
-
Copy full SHA for b1f84c9 - Browse repository at this point
Copy the full SHA b1f84c9View commit details
Commits on Nov 16, 2026
-
Improve backup handling in jsonpatch_cli.py
Handle file replacement and unlinking for backups. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 09f0fc6 - Browse repository at this point
Copy the full SHA 09f0fc6View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 55eb7c5 - Browse repository at this point
Copy the full SHA 55eb7c5View commit details
Commits on Nov 19, 2026
-
test: compare Unicode string values exactly
Signed-off-by: Mohamed Ajab <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5ea6266 - Browse repository at this point
Copy the full SHA 5ea6266View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f5cbda - Browse repository at this point
Copy the full SHA 5f5cbdaView commit details -
Merge pull request #272 from stefankoegl/claude/pointer-object-paths
Serialize and compare patches whose paths are pointer objects
Configuration menu - View commit details
-
Copy full SHA for 1ebce1e - Browse repository at this point
Copy the full SHA 1ebce1eView commit details -
Merge pull request #271 from stefankoegl/claude/cli-error-messages
Report errors of jsondiff and jsonpatch in one line
Configuration menu - View commit details
-
Copy full SHA for 34a7586 - Browse repository at this point
Copy the full SHA 34a7586View commit details -
Merge pull request #270 from stefankoegl/claude/cli-backup-overwrite
Let jsonpatch --backup replace an existing backup
Configuration menu - View commit details
-
Copy full SHA for b88cd76 - Browse repository at this point
Copy the full SHA b88cd76View commit details -
Merge pull request #273 from stefankoegl/claude/make-patch-non-string…
…-keys Reject diffs that change a member whose name is not a string
Configuration menu - View commit details
-
Copy full SHA for f9714ae - Browse repository at this point
Copy the full SHA f9714aeView commit details -
Merge pull request #274 from linluozi/from-diff-copy-fastpath
from_diff: avoid the generic deepcopy and the sorted copy for move keys
Configuration menu - View commit details
-
Copy full SHA for 84a64f5 - Browse repository at this point
Copy the full SHA 84a64f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ff82daa - Browse repository at this point
Copy the full SHA ff82daaView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.47...v1.48