Hello community, here is the log from the commit of package python-python-cjson for openSUSE:Factory checked in at 2020-08-06 10:42:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-cjson (Old) and /work/SRC/openSUSE:Factory/.python-python-cjson.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-cjson" Thu Aug 6 10:42:28 2020 rev:4 rq:824584 version:1.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-cjson/python-python-cjson.changes 2020-05-01 11:12:52.331784683 +0200 +++ /work/SRC/openSUSE:Factory/.python-python-cjson.new.3399/python-python-cjson.changes 2020-08-06 10:42:35.782134348 +0200 @@ -1,0 +2,13 @@ +Wed Aug 5 14:50:03 UTC 2020 - Marketa Calabkova <mcalabk...@suse.com> + +- Update to 1.2.2 + * Fix encoding of UTF-16 surrogate pairs + * Made MANIFEST.in more explicit + * Refactored setup.py to be PEP-8 compliant + * Pass command line arguments from build_inplace to setup.py + * Cleanup after build_inplace + * Explicitly use python2 in shebang lines + * Updated license +- Rebase py3.patch + +------------------------------------------------------------------- Old: ---- python-cjson-1.2.1.tar.gz New: ---- python-cjson-1.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-cjson.spec ++++++ --- /var/tmp/diff_new_pack.Ix8858/_old 2020-08-06 10:42:37.262135090 +0200 +++ /var/tmp/diff_new_pack.Ix8858/_new 2020-08-06 10:42:37.266135092 +0200 @@ -19,10 +19,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-python-cjson -Version: 1.2.1 +Version: 1.2.2 Release: 0 Summary: C-accelerated JSON encoder/decoder for Python -License: LGPL-2.0-or-later +License: LGPL-2.1-or-later Group: Development/Languages/Python URL: https://github.com/AGProjects/python-cjson Source: https://files.pythonhosted.org/packages/source/p/python-cjson/python-cjson-%{version}.tar.gz ++++++ py3.patch ++++++ --- /var/tmp/diff_new_pack.Ix8858/_old 2020-08-06 10:42:37.290135104 +0200 +++ /var/tmp/diff_new_pack.Ix8858/_new 2020-08-06 10:42:37.294135106 +0200 @@ -8,10 +8,10 @@ jsontest.py | 16 ++-- 2 files changed, 144 insertions(+), 140 deletions(-) -diff --git a/cjson.c b/cjson.c -index d3ecc81..a44e7e4 100644 ---- a/cjson.c -+++ b/cjson.c +Index: python-cjson-1.2.2/cjson.c +=================================================================== +--- python-cjson-1.2.2.orig/cjson.c ++++ python-cjson-1.2.2/cjson.c @@ -8,6 +8,16 @@ #include <ctype.h> #include <math.h> @@ -96,11 +96,10 @@ Py_DECREF(str); -@@ -579,75 +594,6 @@ decode_json(JSONData *jsondata) - +@@ -580,75 +595,6 @@ decode_json(JSONData *jsondata) /* ------------------------------ Encoding ----------------------------- */ --/* + /* - * This function is an almost verbatim copy of PyString_Repr() from - * Python's stringobject.c with the following differences: - * @@ -169,9 +168,10 @@ - } -} - - /* +-/* * This function is an almost verbatim copy of unicodeescape_string() from * Python's unicodeobject.c with the following differences: + * @@ -662,7 +608,7 @@ encode_unicode(PyObject *unicode) PyObject *repr; Py_UNICODE *s; @@ -204,7 +204,7 @@ *p++ = '\\'; *p++ = (char) ch; continue; -@@ -801,10 +747,11 @@ encode_unicode(PyObject *unicode) +@@ -782,10 +728,11 @@ encode_unicode(PyObject *unicode) *p++ = (char) ch; } @@ -218,7 +218,7 @@ return repr; } -@@ -825,9 +772,9 @@ encode_tuple(PyObject *tuple) +@@ -806,9 +753,9 @@ encode_tuple(PyObject *tuple) PyObject *pieces, *result = NULL; PyTupleObject *v = (PyTupleObject*) tuple; @@ -230,7 +230,7 @@ pieces = PyTuple_New(n); if (pieces == NULL) -@@ -843,29 +790,29 @@ encode_tuple(PyObject *tuple) +@@ -824,29 +771,29 @@ encode_tuple(PyObject *tuple) /* Add "[]" decorations to the first and last items. */ assert(n > 0); @@ -266,7 +266,7 @@ Py_DECREF(s); Done: -@@ -899,8 +846,8 @@ encode_list(PyObject *list) +@@ -880,8 +827,8 @@ encode_list(PyObject *list) return NULL; } @@ -277,7 +277,7 @@ goto Done; } -@@ -910,7 +857,7 @@ encode_list(PyObject *list) +@@ -891,7 +838,7 @@ encode_list(PyObject *list) /* Do repr() on each element. Note that this may mutate the list, * so must refetch the list size on each iteration. */ @@ -286,7 +286,7 @@ int status; s = encode_object(v->ob_item[i]); if (s == NULL) -@@ -923,29 +870,29 @@ encode_list(PyObject *list) +@@ -904,29 +851,29 @@ encode_list(PyObject *list) /* Add "[]" decorations to the first and last items. */ assert(PyList_GET_SIZE(pieces) > 0); @@ -322,7 +322,7 @@ Py_DECREF(s); Done: -@@ -984,7 +931,7 @@ encode_dict(PyObject *dict) +@@ -965,7 +912,7 @@ encode_dict(PyObject *dict) } if (mp->ma_used == 0) { @@ -331,7 +331,7 @@ goto Done; } -@@ -992,7 +939,7 @@ encode_dict(PyObject *dict) +@@ -973,7 +920,7 @@ encode_dict(PyObject *dict) if (pieces == NULL) goto Done; @@ -340,7 +340,7 @@ if (colon == NULL) goto Done; -@@ -1002,7 +949,7 @@ encode_dict(PyObject *dict) +@@ -983,7 +930,7 @@ encode_dict(PyObject *dict) while (PyDict_Next((PyObject *)mp, &i, &key, &value)) { int status; @@ -349,7 +349,7 @@ PyErr_SetString(JSON_EncodeError, "JSON encodable dictionaries " "must have string/unicode keys"); goto Done; -@@ -1010,9 +957,10 @@ encode_dict(PyObject *dict) +@@ -991,9 +938,10 @@ encode_dict(PyObject *dict) /* Prevent repr from deleting value during key format. */ Py_INCREF(value); @@ -363,7 +363,7 @@ Py_DECREF(value); if (s == NULL) goto Done; -@@ -1024,35 +972,36 @@ encode_dict(PyObject *dict) +@@ -1005,35 +953,36 @@ encode_dict(PyObject *dict) /* Add "{}" decorations to the first and last items. */ assert(PyList_GET_SIZE(pieces) > 0); @@ -406,7 +406,7 @@ return result; } -@@ -1061,29 +1010,27 @@ static PyObject* +@@ -1042,29 +991,27 @@ static PyObject* encode_object(PyObject *object) { if (object == Py_True) { @@ -443,7 +443,7 @@ return PyObject_Str(object); } else if (PyList_Check(object)) { PyObject *result; -@@ -1130,6 +1077,7 @@ JSON_decode(PyObject *self, PyObject *args, PyObject *kwargs) +@@ -1111,6 +1058,7 @@ JSON_decode(PyObject *self, PyObject *ar static char *kwlist[] = {"json", "all_unicode", NULL}; int all_unicode = False; // by default return unicode only when needed PyObject *object, *string, *str; @@ -451,7 +451,7 @@ JSONData jsondata; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:decode", kwlist, -@@ -1146,13 +1094,13 @@ JSON_decode(PyObject *self, PyObject *args, PyObject *kwargs) +@@ -1127,13 +1075,13 @@ JSON_decode(PyObject *self, PyObject *ar str = string; } @@ -467,7 +467,7 @@ jsondata.all_unicode = all_unicode; object = decode_json(&jsondata); -@@ -1198,37 +1146,93 @@ PyDoc_STRVAR(module_doc, +@@ -1179,37 +1127,93 @@ PyDoc_STRVAR(module_doc, /* Initialization function for the module (*must* be called initcjson) */ @@ -567,11 +567,11 @@ } - - -diff --git a/jsontest.py b/jsontest.py -index 0f79307..19c24fa 100644 ---- a/jsontest.py -+++ b/jsontest.py -@@ -128,7 +128,7 @@ def testReadBadEscapedHexCharacter(self): +Index: python-cjson-1.2.2/jsontest.py +=================================================================== +--- python-cjson-1.2.2.orig/jsontest.py ++++ python-cjson-1.2.2/jsontest.py +@@ -128,7 +128,7 @@ class JsonTest(unittest.TestCase): self.assertRaises(_exception, self.doReadBadEscapedHexCharacter) def doReadBadEscapedHexCharacter(self): @@ -580,7 +580,7 @@ def testReadBadObjectKey(self): self.assertRaises(_exception, self.doReadBadObjectKey) -@@ -141,7 +141,7 @@ def testReadBadArray(self): +@@ -141,7 +141,7 @@ class JsonTest(unittest.TestCase): def doReadBadArray(self): cjson.decode('[1,2,3,,]') @@ -589,7 +589,7 @@ def testReadBadObjectSyntax(self): self.assertRaises(_exception, self.doReadBadObjectSyntax) -@@ -159,7 +159,7 @@ def testReadIntegerValue(self): +@@ -159,7 +159,7 @@ class JsonTest(unittest.TestCase): def testReadNegativeIntegerValue(self): obj = cjson.decode('{ "key" : -44 }') self.assertEqual({ "key" : -44 }, obj) @@ -598,7 +598,7 @@ def testReadFloatValue(self): obj = cjson.decode('{ "age" : 44.5 }') self.assertEqual({ "age" : 44.5 }, obj) -@@ -176,7 +176,7 @@ def doReadBadNumber(self): +@@ -176,7 +176,7 @@ class JsonTest(unittest.TestCase): def testReadSmallObject(self): obj = cjson.decode('{ "name" : "Patrick", "age":44} ') @@ -607,7 +607,7 @@ def testReadEmptyArray(self): obj = cjson.decode('[]') -@@ -194,7 +194,7 @@ def testWriteSmallArray(self): +@@ -194,7 +194,7 @@ class JsonTest(unittest.TestCase): def testWriteSmallObject(self): s = cjson.encode({ "name" : "Patrick", "age": 44 }) @@ -616,7 +616,7 @@ def testWriteFloat(self): n = 3.44556677 -@@ -276,7 +276,7 @@ def testWriteComplexArray(self): +@@ -276,7 +276,7 @@ class JsonTest(unittest.TestCase): obj = [{"name":"Patrick","age":44,"Employed?":True,"Female?":False,"grandchildren":None}, "used","abused","confused", 1,2,[3,4,5]] @@ -625,7 +625,7 @@ _removeWhitespace(cjson.encode(obj))) -@@ -290,7 +290,7 @@ def testReadWriteCopies(self): +@@ -290,7 +290,7 @@ class JsonTest(unittest.TestCase): def testStringEncoding(self): s = cjson.encode([1, 2, 3]) @@ -634,9 +634,9 @@ def testReadEmptyObjectAtEndOfArray(self): self.assertEqual(["a","b","c",{}], -@@ -329,7 +329,7 @@ def testWriteLongUnicode(self): +@@ -331,7 +331,7 @@ class JsonTest(unittest.TestCase): u'\u1234\u1234\u1234\u1234\u1234\u1234') - self.assertEqual(r'"\U0001d11e\U0001d11e\U0001d11e\U0001d11e' + self.assertEqual(r'"\ud834\udd1e\ud834\udd1e\ud834\udd1e\ud834\udd1e' r'\u1234\u1234\u1234\u1234\u1234\u1234"', s) - + ++++++ python-cjson-1.2.1.tar.gz -> python-cjson-1.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/ChangeLog new/python-cjson-1.2.2/ChangeLog --- old/python-cjson-1.2.1/ChangeLog 2017-02-28 14:32:33.000000000 +0100 +++ new/python-cjson-1.2.2/ChangeLog 2020-02-13 16:45:25.000000000 +0100 @@ -1,3 +1,14 @@ +Changes in version 1.2.2 +------------------------ + + * Fix encoding of UTF-16 surrogate pairs + * Made MANIFEST.in more explicit + * Refactored setup.py to be PEP-8 compliant + * Pass command line arguments from build_inplace to setup.py + * Cleanup after build_inplace + * Explicitly use python2 in shebang lines + * Updated license + Changes in version 1.2.1 ------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/LICENSE new/python-cjson-1.2.2/LICENSE --- old/python-cjson-1.2.1/LICENSE 2017-02-28 14:12:12.000000000 +0100 +++ new/python-cjson-1.2.2/LICENSE 2020-02-13 16:46:23.000000000 +0100 @@ -1,18 +1,15 @@ +Copyright 2006-2020 Dan Pascu -Copyright (C) 2006-2017 -Dan Pascu +License: LGPL-2.1+ -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library; if not, write to the Free Software Foundation, -Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + For a copy of the license see https://www.gnu.org/licenses/lgpl-2.1.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/MANIFEST.in new/python-cjson-1.2.2/MANIFEST.in --- old/python-cjson-1.2.1/MANIFEST.in 2007-07-25 16:00:22.000000000 +0200 +++ new/python-cjson-1.2.2/MANIFEST.in 2019-09-20 14:24:57.000000000 +0200 @@ -1 +1,7 @@ -include LICENSE ChangeLog MANIFEST.in build_inplace jsontest.py +include ChangeLog +include LICENSE +include README +include MANIFEST.in + +include build_inplace +include jsontest.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/PKG-INFO new/python-cjson-1.2.2/PKG-INFO --- old/python-cjson-1.2.1/PKG-INFO 2017-02-28 14:34:13.000000000 +0100 +++ new/python-cjson-1.2.2/PKG-INFO 2020-03-20 05:10:40.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-cjson -Version: 1.2.1 +Version: 1.2.2 Summary: Fast JSON encoder/decoder for Python Home-page: https://github.com/AGProjects/python-cjson Author: Dan Pascu diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/build_inplace new/python-cjson-1.2.2/build_inplace --- old/python-cjson-1.2.1/build_inplace 2006-03-18 09:49:34.000000000 +0100 +++ new/python-cjson-1.2.2/build_inplace 2020-02-07 10:12:15.000000000 +0100 @@ -1,5 +1,5 @@ #!/bin/sh -python setup.py build_ext --inplace -python setup.py clean +python setup.py build_ext --inplace "$@" +test -d build && python setup.py clean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/cjson.c new/python-cjson-1.2.2/cjson.c --- old/python-cjson-1.2.1/cjson.c 2017-02-28 14:14:09.000000000 +0100 +++ new/python-cjson-1.2.2/cjson.c 2018-10-02 18:09:20.000000000 +0200 @@ -666,7 +666,7 @@ static const char *hexdigit = "0123456789abcdef"; #ifdef Py_UNICODE_WIDE - const Py_ssize_t expandsize = 10; + const Py_ssize_t expandsize = 12; #else const Py_ssize_t expandsize = 6; #endif @@ -713,46 +713,27 @@ } #ifdef Py_UNICODE_WIDE - /* Map 21-bit characters to '\U00xxxxxx' */ + /* Map 21-bit characters to UTF-16 surrogate pairs */ else if (ch >= 0x10000) { + unsigned short ucs1, ucs2; + ucs1 = (unsigned short)(((ch - 0x10000) >> 10) & 0x03FF) + 0xD800; + ucs2 = (unsigned short)((ch - 0x10000) & 0x03FF) + 0xDC00; + + *p++ = '\\'; + *p++ = 'u'; + *p++ = hexdigit[(ucs1 >> 12) & 0x000F]; + *p++ = hexdigit[(ucs1 >> 8) & 0x000F]; + *p++ = hexdigit[(ucs1 >> 4) & 0x000F]; + *p++ = hexdigit[ucs1 & 0x000F]; *p++ = '\\'; - *p++ = 'U'; - *p++ = hexdigit[(ch >> 28) & 0x0000000F]; - *p++ = hexdigit[(ch >> 24) & 0x0000000F]; - *p++ = hexdigit[(ch >> 20) & 0x0000000F]; - *p++ = hexdigit[(ch >> 16) & 0x0000000F]; - *p++ = hexdigit[(ch >> 12) & 0x0000000F]; - *p++ = hexdigit[(ch >> 8) & 0x0000000F]; - *p++ = hexdigit[(ch >> 4) & 0x0000000F]; - *p++ = hexdigit[ch & 0x0000000F]; + *p++ = 'u'; + *p++ = hexdigit[(ucs2 >> 12) & 0x000F]; + *p++ = hexdigit[(ucs2 >> 8) & 0x000F]; + *p++ = hexdigit[(ucs2 >> 4) & 0x000F]; + *p++ = hexdigit[ucs2 & 0x000F]; continue; } #endif - /* Map UTF-16 surrogate pairs to Unicode \UXXXXXXXX escapes */ - else if (ch >= 0xD800 && ch < 0xDC00) { - Py_UNICODE ch2; - Py_UCS4 ucs; - - ch2 = *s++; - size--; - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - *p++ = '\\'; - *p++ = 'U'; - *p++ = hexdigit[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigit[ucs & 0x0000000F]; - continue; - } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/jsontest.py new/python-cjson-1.2.2/jsontest.py --- old/python-cjson-1.2.1/jsontest.py 2011-06-21 07:09:21.000000000 +0200 +++ new/python-cjson-1.2.2/jsontest.py 2020-02-07 17:37:14.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 ## this test suite is an almost verbatim copy of the jsontest.py test suite ## found in json-py available from http://sourceforge.net/projects/json-py/ @@ -325,9 +325,11 @@ # narrow-but-escaped characters prevents string resizing. # Note that u'\U0001D11E\u1234' also breaks, but sometimes goes # undetected. + # In any case, in ECMA-404, only utf-16 surrogate pairs are + # valid, so \U0001D11E should be encoded as \ud834\udd1e s = cjson.encode(u'\U0001D11E\U0001D11E\U0001D11E\U0001D11E' u'\u1234\u1234\u1234\u1234\u1234\u1234') - self.assertEqual(r'"\U0001d11e\U0001d11e\U0001d11e\U0001d11e' + self.assertEqual(r'"\ud834\udd1e\ud834\udd1e\ud834\udd1e\ud834\udd1e' r'\u1234\u1234\u1234\u1234\u1234\u1234"', s) def main(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cjson-1.2.1/setup.py new/python-cjson-1.2.2/setup.py --- old/python-cjson-1.2.1/setup.py 2017-02-28 14:31:46.000000000 +0100 +++ new/python-cjson-1.2.2/setup.py 2020-02-13 16:45:37.000000000 +0100 @@ -1,29 +1,34 @@ -#!/usr/bin/python +#!/usr/bin/python2 from distutils.core import setup, Extension -__version__ = "1.2.1" +__version__ = '1.2.2' macros = [('MODULE_VERSION', __version__)] -setup(name = "python-cjson", - version = __version__, - author = "Dan Pascu", - author_email = "d...@ag-projects.com", - url = "https://github.com/AGProjects/python-cjson", - description = "Fast JSON encoder/decoder for Python", - long_description = open('README').read(), - license = "LGPL", - platforms = ["Platform Independent"], - classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Topic :: Software Development :: Libraries :: Python Modules" - ], - ext_modules = [ +setup( + name='python-cjson', + version=__version__, + + description='Fast JSON encoder/decoder for Python', + long_description=open('README').read(), + url='https://github.com/AGProjects/python-cjson', + license='LGPL', + + author='Dan Pascu', + author_email='d...@ag-projects.com', + + platforms=['Platform Independent'], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Software Development :: Libraries :: Python Modules' + ], + + ext_modules=[ Extension(name='cjson', sources=['cjson.c'], define_macros=macros) - ] + ] )