jsonpatch 1.45__py3-none-any.whl → 1.46__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jsonpatch-1.45.dist-info → jsonpatch-1.46.dist-info}/METADATA +1 -1
- jsonpatch-1.46.dist-info/RECORD +10 -0
- jsonpatch.py +5 -5
- jsonpatch_cli.py +4 -4
- jsonpatch-1.45.dist-info/RECORD +0 -10
- {jsonpatch-1.45.dist-info → jsonpatch-1.46.dist-info}/WHEEL +0 -0
- {jsonpatch-1.45.dist-info → jsonpatch-1.46.dist-info}/entry_points.txt +0 -0
- {jsonpatch-1.45.dist-info → jsonpatch-1.46.dist-info}/licenses/AUTHORS +0 -0
- {jsonpatch-1.45.dist-info → jsonpatch-1.46.dist-info}/licenses/LICENSE +0 -0
- {jsonpatch-1.45.dist-info → jsonpatch-1.46.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
jsonpatch.py,sha256=sz9iNxPEu-f_77tMj8BPsJW5QlocVZJCbtK6tSVL9Lk,67486
|
|
2
|
+
jsonpatch_cli.py,sha256=I6sWWbPzQ8uMo86Akufb3GSt10_mxg56z71HmpgxkZw,6496
|
|
3
|
+
jsonpatch-1.46.dist-info/licenses/AUTHORS,sha256=hOtEnBGbfDegKjzMDEl5vuVJyczbI2PlYE2ho4LjGNQ,140
|
|
4
|
+
jsonpatch-1.46.dist-info/licenses/LICENSE,sha256=Q5PrZzP6HjZ_QXabOC9PG-e_Da6x4kPtkrP12Lr9I28,1481
|
|
5
|
+
jsonpatch-stubs/__init__.pyi,sha256=ARV0JxPJ3TZbYk1hUbayPO3gJVP0geIQK6fftWM-4KY,5623
|
|
6
|
+
jsonpatch-1.46.dist-info/METADATA,sha256=oUhUkUlyRTxTLA2yjjzjC5S22f2ucDfeQ2i8kmJyzNs,4748
|
|
7
|
+
jsonpatch-1.46.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
8
|
+
jsonpatch-1.46.dist-info/entry_points.txt,sha256=aY9ormBVRZHHDaAeMcdqTBwZ-ax7GvBTSQ33I75xtZM,98
|
|
9
|
+
jsonpatch-1.46.dist-info/top_level.txt,sha256=AGmziZtf5TSFAtbhYlhDGjQg1POmwzF9HwLdbzPkoio,40
|
|
10
|
+
jsonpatch-1.46.dist-info/RECORD,,
|
jsonpatch.py
CHANGED
|
@@ -59,7 +59,7 @@ _JSONPOINTER_FROM_PARTS = JsonPointer.from_parts.__func__
|
|
|
59
59
|
|
|
60
60
|
# Will be parsed by setup.py to determine package metadata
|
|
61
61
|
__author__ = 'Stefan Kögl <stefan@skoegl.net>'
|
|
62
|
-
__version__ = '1.
|
|
62
|
+
__version__ = '1.46'
|
|
63
63
|
__website__ = 'https://github.com/stefankoegl/python-json-patch'
|
|
64
64
|
__license__ = 'BSD-3-Clause'
|
|
65
65
|
|
|
@@ -1577,13 +1577,13 @@ def _json_equal(first, second):
|
|
|
1577
1577
|
if isinstance(first, bool) or isinstance(second, bool):
|
|
1578
1578
|
return isinstance(first, bool) and isinstance(second, bool) and \
|
|
1579
1579
|
first == second
|
|
1580
|
-
if isinstance(first,
|
|
1581
|
-
isinstance(second, MutableMapping):
|
|
1580
|
+
if isinstance(first, Mapping) and isinstance(second, Mapping):
|
|
1582
1581
|
return len(first) == len(second) and all(
|
|
1583
1582
|
key in second and _json_equal(first[key], second[key])
|
|
1584
1583
|
for key in first)
|
|
1585
|
-
if isinstance(first,
|
|
1586
|
-
isinstance(
|
|
1584
|
+
if isinstance(first, Sequence) and isinstance(second, Sequence) and \
|
|
1585
|
+
not isinstance(first, (str, bytes)) and \
|
|
1586
|
+
not isinstance(second, (str, bytes)):
|
|
1587
1587
|
return len(first) == len(second) and all(
|
|
1588
1588
|
_json_equal(*items) for items in zip(first, second))
|
|
1589
1589
|
return first == second
|
jsonpatch_cli.py
CHANGED
|
@@ -13,8 +13,8 @@ from contextlib import ExitStack
|
|
|
13
13
|
|
|
14
14
|
jsondiff_parser = argparse.ArgumentParser(
|
|
15
15
|
prog='jsondiff', description='Diff two JSON files')
|
|
16
|
-
jsondiff_parser.add_argument('FILE1', type=argparse.FileType('r', encoding='utf-8'))
|
|
17
|
-
jsondiff_parser.add_argument('FILE2', type=argparse.FileType('r', encoding='utf-8'))
|
|
16
|
+
jsondiff_parser.add_argument('FILE1', type=argparse.FileType('r', encoding='utf-8-sig'))
|
|
17
|
+
jsondiff_parser.add_argument('FILE2', type=argparse.FileType('r', encoding='utf-8-sig'))
|
|
18
18
|
jsondiff_parser.add_argument('--indent', type=int, default=None,
|
|
19
19
|
help='Indent output by n spaces')
|
|
20
20
|
jsondiff_parser.add_argument('-u', '--preserve-unicode', action='store_true',
|
|
@@ -51,9 +51,9 @@ def diff_files():
|
|
|
51
51
|
jsonpatch_parser = argparse.ArgumentParser(
|
|
52
52
|
prog='jsonpatch',
|
|
53
53
|
description='Apply a JSON patch on a JSON file')
|
|
54
|
-
jsonpatch_parser.add_argument('ORIGINAL', type=argparse.FileType('r', encoding='utf-8'),
|
|
54
|
+
jsonpatch_parser.add_argument('ORIGINAL', type=argparse.FileType('r', encoding='utf-8-sig'),
|
|
55
55
|
help='Original file')
|
|
56
|
-
jsonpatch_parser.add_argument('PATCH', type=argparse.FileType('r', encoding='utf-8'),
|
|
56
|
+
jsonpatch_parser.add_argument('PATCH', type=argparse.FileType('r', encoding='utf-8-sig'),
|
|
57
57
|
nargs='?', default=sys.stdin,
|
|
58
58
|
help='Patch file (read from stdin if omitted)')
|
|
59
59
|
jsonpatch_parser.add_argument('--indent', type=int, default=None,
|
jsonpatch-1.45.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
jsonpatch.py,sha256=5Vs9OIFV2aioCf4LuMX4CfltVoYwhQAHJGp7u6DtNW0,67433
|
|
2
|
-
jsonpatch_cli.py,sha256=Vavn3OY4KrowXNTRDbgsNPcd9vTGLkIgz0Hr6Uwr5mk,6480
|
|
3
|
-
jsonpatch-1.45.dist-info/licenses/AUTHORS,sha256=hOtEnBGbfDegKjzMDEl5vuVJyczbI2PlYE2ho4LjGNQ,140
|
|
4
|
-
jsonpatch-1.45.dist-info/licenses/LICENSE,sha256=Q5PrZzP6HjZ_QXabOC9PG-e_Da6x4kPtkrP12Lr9I28,1481
|
|
5
|
-
jsonpatch-stubs/__init__.pyi,sha256=ARV0JxPJ3TZbYk1hUbayPO3gJVP0geIQK6fftWM-4KY,5623
|
|
6
|
-
jsonpatch-1.45.dist-info/METADATA,sha256=255V0zWc9-62CxfdBebjRFLt0pal9KGRqBnC5vPnUPY,4748
|
|
7
|
-
jsonpatch-1.45.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
8
|
-
jsonpatch-1.45.dist-info/entry_points.txt,sha256=aY9ormBVRZHHDaAeMcdqTBwZ-ax7GvBTSQ33I75xtZM,98
|
|
9
|
-
jsonpatch-1.45.dist-info/top_level.txt,sha256=AGmziZtf5TSFAtbhYlhDGjQg1POmwzF9HwLdbzPkoio,40
|
|
10
|
-
jsonpatch-1.45.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|