Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-jsonpatch for
openSUSE:Factory checked in at 2021-05-20 19:23:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsonpatch (Old)
and /work/SRC/openSUSE:Factory/.python-jsonpatch.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jsonpatch"
Thu May 20 19:23:25 2021 rev:24 rq:894164 version:1.32
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsonpatch/python-jsonpatch.changes
2021-04-26 16:39:00.262016425 +0200
+++
/work/SRC/openSUSE:Factory/.python-jsonpatch.new.2988/python-jsonpatch.changes
2021-05-20 19:23:50.094247982 +0200
@@ -1,0 +2,6 @@
+Tue May 18 21:54:01 UTC 2021 - Dirk M??ller <[email protected]>
+
+- update to 1.32:
+ * take_index causing 'move' of incorrect values due to bad True==1
comparison
+
+-------------------------------------------------------------------
Old:
----
jsonpatch-1.31.tar.gz
New:
----
jsonpatch-1.32.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jsonpatch.spec ++++++
--- /var/tmp/diff_new_pack.1PyF1l/_old 2021-05-20 19:23:50.578245933 +0200
+++ /var/tmp/diff_new_pack.1PyF1l/_new 2021-05-20 19:23:50.582245917 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jsonpatch
-Version: 1.31
+Version: 1.32
Release: 0
Summary: Python - JSON-Patches
License: BSD-3-Clause
++++++ jsonpatch-1.31.tar.gz -> jsonpatch-1.32.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.31/PKG-INFO new/jsonpatch-1.32/PKG-INFO
--- old/jsonpatch-1.31/PKG-INFO 2021-03-04 20:15:29.000000000 +0100
+++ new/jsonpatch-1.32/PKG-INFO 2021-03-13 20:16:36.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: jsonpatch
-Version: 1.31
+Version: 1.32
Summary: Apply JSON-Patches (RFC 6902)
Home-page: https://github.com/stefankoegl/python-json-patch
Author: Stefan K??gl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.31/jsonpatch.egg-info/PKG-INFO
new/jsonpatch-1.32/jsonpatch.egg-info/PKG-INFO
--- old/jsonpatch-1.31/jsonpatch.egg-info/PKG-INFO 2021-03-04
20:15:29.000000000 +0100
+++ new/jsonpatch-1.32/jsonpatch.egg-info/PKG-INFO 2021-03-13
20:16:36.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: jsonpatch
-Version: 1.31
+Version: 1.32
Summary: Apply JSON-Patches (RFC 6902)
Home-page: https://github.com/stefankoegl/python-json-patch
Author: Stefan K??gl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.31/jsonpatch.py
new/jsonpatch-1.32/jsonpatch.py
--- old/jsonpatch-1.31/jsonpatch.py 2021-03-04 20:15:07.000000000 +0100
+++ new/jsonpatch-1.32/jsonpatch.py 2021-03-13 20:16:15.000000000 +0100
@@ -61,7 +61,7 @@
# Will be parsed by setup.py to determine package metadata
__author__ = 'Stefan K??gl <[email protected]>'
-__version__ = '1.31'
+__version__ = '1.32'
__website__ = 'https://github.com/stefankoegl/python-json-patch'
__license__ = 'Modified BSD License'
@@ -699,27 +699,29 @@
root[:] = [root, root, None]
def store_index(self, value, index, st):
+ typed_key = (value, type(value))
try:
storage = self.index_storage[st]
- stored = storage.get(value)
+ stored = storage.get(typed_key)
if stored is None:
- storage[value] = [index]
+ storage[typed_key] = [index]
else:
- storage[value].append(index)
+ storage[typed_key].append(index)
except TypeError:
- self.index_storage2[st].append((value, index))
+ self.index_storage2[st].append((typed_key, index))
def take_index(self, value, st):
+ typed_key = (value, type(value))
try:
- stored = self.index_storage[st].get(value)
+ stored = self.index_storage[st].get(typed_key)
if stored:
return stored.pop()
except TypeError:
storage = self.index_storage2[st]
for i in range(len(storage)-1, -1, -1):
- if storage[i][0] == value:
+ if storage[i][0] == typed_key:
return storage.pop(i)[1]
def insert(self, op):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonpatch-1.31/tests.py new/jsonpatch-1.32/tests.py
--- old/jsonpatch-1.31/tests.py 2021-03-04 20:15:07.000000000 +0100
+++ new/jsonpatch-1.32/tests.py 2021-03-13 20:16:15.000000000 +0100
@@ -481,6 +481,15 @@
self.assertEqual(res, dst)
self.assertIsInstance(res['A'], bool)
+ def test_issue129(self):
+ """In JSON 1 is different from True even though in python 1 == True
Take Two"""
+ src = {'A': {'D': 1.0}, 'B': {'E': 'a'}}
+ dst = {'A': {'C': 'a'}, 'B': {'C': True}}
+ patch = jsonpatch.make_patch(src, dst)
+ res = jsonpatch.apply_patch(src, patch)
+ self.assertEqual(res, dst)
+ self.assertIsInstance(res['B']['C'], bool)
+
def test_issue103(self):
"""In JSON 1 is different from 1.0 even though in python 1 == 1.0"""
src = {'A': 1}