Hello community,
here is the log from the commit of package python-jsonpatch for
openSUSE:Factory checked in at 2020-03-08 22:21:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsonpatch (Old)
and /work/SRC/openSUSE:Factory/.python-jsonpatch.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jsonpatch"
Sun Mar 8 22:21:31 2020 rev:20 rq:780383 version:1.25
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsonpatch/python-jsonpatch.changes
2019-09-23 12:08:46.369891872 +0200
+++
/work/SRC/openSUSE:Factory/.python-jsonpatch.new.26092/python-jsonpatch.changes
2020-03-08 22:21:35.075982952 +0100
@@ -1,0 +2,6 @@
+Fri Feb 28 21:34:10 UTC 2020 - Dirk Mueller <[email protected]>
+
+- update to 1.25:
+ * bugfixes, 3.8 support
+
+-------------------------------------------------------------------
Old:
----
jsonpatch-1.24.tar.gz
New:
----
jsonpatch-1.25.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jsonpatch.spec ++++++
--- /var/tmp/diff_new_pack.RHGRlH/_old 2020-03-08 22:21:36.835984037 +0100
+++ /var/tmp/diff_new_pack.RHGRlH/_new 2020-03-08 22:21:36.871984060 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-jsonpatch
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jsonpatch
-Version: 1.24
+Version: 1.25
Release: 0
Summary: Python - JSON-Patches
License: BSD-3-Clause
++++++ jsonpatch-1.24.tar.gz -> jsonpatch-1.25.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.24/PKG-INFO new/jsonpatch-1.25/PKG-INFO
--- old/jsonpatch-1.24/PKG-INFO 2019-07-28 18:07:34.000000000 +0200
+++ new/jsonpatch-1.25/PKG-INFO 2020-01-29 09:22:05.000000000 +0100
@@ -1,17 +1,17 @@
Metadata-Version: 1.2
Name: jsonpatch
-Version: 1.24
+Version: 1.25
Summary: Apply JSON-Patches (RFC 6902)
Home-page: https://github.com/stefankoegl/python-json-patch
Author: Stefan Kögl
Author-email: [email protected]
License: Modified BSD License
Project-URL: Website, https://github.com/stefankoegl/python-json-patch
-Project-URL: Tests, https://travis-ci.org/stefankoegl/python-json-patch
Project-URL: Repository, https://github.com/stefankoegl/python-json-patch.git
-Project-URL: Test Coverage,
https://coveralls.io/r/stefankoegl/python-json-patch
Project-URL: Documentation, https://python-json-patch.readthedocs.org/
Project-URL: PyPI, https://pypi.org/pypi/jsonpatch
+Project-URL: Tests, https://travis-ci.org/stefankoegl/python-json-patch
+Project-URL: Test Coverage,
https://coveralls.io/r/stefankoegl/python-json-patch
Description: python-json-patch
=================
@@ -62,12 +62,12 @@
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.24/jsonpatch.egg-info/PKG-INFO
new/jsonpatch-1.25/jsonpatch.egg-info/PKG-INFO
--- old/jsonpatch-1.24/jsonpatch.egg-info/PKG-INFO 2019-07-28
18:07:34.000000000 +0200
+++ new/jsonpatch-1.25/jsonpatch.egg-info/PKG-INFO 2020-01-29
09:22:05.000000000 +0100
@@ -1,17 +1,17 @@
Metadata-Version: 1.2
Name: jsonpatch
-Version: 1.24
+Version: 1.25
Summary: Apply JSON-Patches (RFC 6902)
Home-page: https://github.com/stefankoegl/python-json-patch
Author: Stefan Kögl
Author-email: [email protected]
License: Modified BSD License
Project-URL: Website, https://github.com/stefankoegl/python-json-patch
-Project-URL: Tests, https://travis-ci.org/stefankoegl/python-json-patch
Project-URL: Repository, https://github.com/stefankoegl/python-json-patch.git
-Project-URL: Test Coverage,
https://coveralls.io/r/stefankoegl/python-json-patch
Project-URL: Documentation, https://python-json-patch.readthedocs.org/
Project-URL: PyPI, https://pypi.org/pypi/jsonpatch
+Project-URL: Tests, https://travis-ci.org/stefankoegl/python-json-patch
+Project-URL: Test Coverage,
https://coveralls.io/r/stefankoegl/python-json-patch
Description: python-json-patch
=================
@@ -62,12 +62,12 @@
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.24/jsonpatch.py
new/jsonpatch-1.25/jsonpatch.py
--- old/jsonpatch-1.24/jsonpatch.py 2019-07-28 18:07:12.000000000 +0200
+++ new/jsonpatch-1.25/jsonpatch.py 2020-01-29 09:18:14.000000000 +0100
@@ -56,7 +56,7 @@
# Will be parsed by setup.py to determine package metadata
__author__ = 'Stefan Kögl <[email protected]>'
-__version__ = '1.24'
+__version__ = '1.25'
__website__ = 'https://github.com/stefankoegl/python-json-patch'
__license__ = 'Modified BSD License'
@@ -474,7 +474,7 @@
return value
if isinstance(subobj, MutableSequence):
- if part > len(subobj) or part < 0:
+ if part >= len(subobj) or part < 0:
raise JsonPatchConflict("can't replace outside of list")
elif isinstance(subobj, MutableMapping):
@@ -817,10 +817,7 @@
self._item_added(path, key, dst[key])
def _compare_values(self, path, key, src, dst):
- if src == dst:
- return
-
- elif isinstance(src, MutableMapping) and \
+ if isinstance(src, MutableMapping) and \
isinstance(dst, MutableMapping):
self._compare_dicts(_path_join(path, key), src, dst)
@@ -828,6 +825,16 @@
isinstance(dst, MutableSequence):
self._compare_lists(_path_join(path, key), src, dst)
+ # To ensure we catch changes to JSON, we can't rely on a simple
+ # src == dst, or it would not recognize the difference between
+ # 1 and True, among other things. Using json.dumps is the most
+ # fool-proof way to ensure we catch type changes that matter to JSON
+ # and ignore those that don't. The performance of this could be
+ # improved by doing more direct type checks, but we'd need to be
+ # careful to accept type changes that don't matter when JSONified.
+ elif json.dumps(src) == json.dumps(dst):
+ return
+
else:
self._item_replaced(path, key, dst)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.24/setup.py new/jsonpatch-1.25/setup.py
--- old/jsonpatch-1.24/setup.py 2019-07-28 18:07:12.000000000 +0200
+++ new/jsonpatch-1.25/setup.py 2020-01-29 09:16:32.000000000 +0100
@@ -56,10 +56,10 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
@@ -79,7 +79,7 @@
package_data={'': ['requirements.txt']},
scripts=['bin/jsondiff', 'bin/jsonpatch'],
classifiers=CLASSIFIERS,
- python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
project_urls={
'Website': 'https://github.com/stefankoegl/python-json-patch',
'Repository': 'https://github.com/stefankoegl/python-json-patch.git',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.24/tests.py new/jsonpatch-1.25/tests.py
--- old/jsonpatch-1.24/tests.py 2019-07-28 18:07:12.000000000 +0200
+++ new/jsonpatch-1.25/tests.py 2020-01-29 09:16:32.000000000 +0100
@@ -427,6 +427,24 @@
res = jsonpatch.apply_patch(src, patch)
self.assertEqual(res, dst)
+ def test_issue90(self):
+ """In JSON 1 is different from True even though in python 1 == True"""
+ src = {'A': 1}
+ dst = {'A': True}
+ patch = jsonpatch.make_patch(src, dst)
+ res = jsonpatch.apply_patch(src, patch)
+ self.assertEqual(res, dst)
+ self.assertIsInstance(res['A'], bool)
+
+ def test_issue103(self):
+ """In JSON 1 is different from 1.0 even though in python 1 == 1.0"""
+ src = {'A': 1}
+ dst = {'A': 1.0}
+ patch = jsonpatch.make_patch(src, dst)
+ res = jsonpatch.apply_patch(src, patch)
+ self.assertEqual(res, dst)
+ self.assertIsInstance(res['A'], float)
+
class OptimizationTests(unittest.TestCase):
@@ -611,6 +629,11 @@
patch_obj = [ { "op": "replace", "path": "/foo/10", "value": 10} ]
self.assertRaises(jsonpatch.JsonPatchConflict, jsonpatch.apply_patch,
src, patch_obj)
+ def test_replace_oob_length(self):
+ src = {"foo": [0, 1]}
+ patch_obj = [ { "op": "replace", "path": "/foo/2", "value": 2} ]
+ self.assertRaises(jsonpatch.JsonPatchConflict, jsonpatch.apply_patch,
src, patch_obj)
+
def test_replace_missing(self):
src = {"foo": 1}
patch_obj = [ { "op": "replace", "path": "/bar", "value": 10} ]