Hello community, here is the log from the commit of package python-simplejson for openSUSE:Factory checked in at 2017-11-11 14:17:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-simplejson (Old) and /work/SRC/openSUSE:Factory/.python-simplejson.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-simplejson" Sat Nov 11 14:17:56 2017 rev:36 rq:539601 version:3.12.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-simplejson/python-simplejson.changes 2017-08-14 12:37:14.091467671 +0200 +++ /work/SRC/openSUSE:Factory/.python-simplejson.new/python-simplejson.changes 2017-11-11 14:17:58.698779517 +0100 @@ -1,0 +2,9 @@ +Mon Nov 6 16:57:44 UTC 2017 - [email protected] + +- update to version 3.12.0: + * Fix threaded import race condition + https://github.com/simplejson/simplejson/issues/184 + * Move RawJSON implementation to simplejson.raw_json module + * Move JSONDecodeError implementation to simplejson.errors module + +------------------------------------------------------------------- Old: ---- simplejson-3.11.1.tar.gz New: ---- simplejson-3.12.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-simplejson.spec ++++++ --- /var/tmp/diff_new_pack.QHN8Ar/_old 2017-11-11 14:18:02.894625735 +0100 +++ /var/tmp/diff_new_pack.QHN8Ar/_new 2017-11-11 14:18:02.898625588 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-simplejson -Version: 3.11.1 +Version: 3.12.0 Release: 0 Summary: Simple, fast, extensible JSON encoder/decoder for Python License: MIT or AFL-2.1 ++++++ simplejson-3.11.1.tar.gz -> simplejson-3.12.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/CHANGES.txt new/simplejson-3.12.0/CHANGES.txt --- old/simplejson-3.11.1/CHANGES.txt 2017-06-19 22:11:11.000000000 +0200 +++ new/simplejson-3.12.0/CHANGES.txt 2017-11-05 19:26:25.000000000 +0100 @@ -1,3 +1,10 @@ +Version 3.12.0 released 2017-11-05 + +* Fix threaded import race condition + https://github.com/simplejson/simplejson/issues/184 +* Move RawJSON implementation to simplejson.raw_json module +* Move JSONDecodeError implementation to simplejson.errors module + Version 3.11.1 released 2017-06-19 * Fix issue with item_sort_key when speedups are available, and add @@ -274,7 +281,7 @@ * Python 3.3 is now supported, thanks to Vinay Sajip https://github.com/simplejson/simplejson/issues/8 -* `sort_keys`/`item_sort_key` now sort on the stringified verison of the +* `sort_keys`/`item_sort_key` now sort on the stringified version of the key, rather than the original object. This ensures that the sort only compares string types and makes the behavior consistent between Python 2.x and Python 3.x. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/PKG-INFO new/simplejson-3.12.0/PKG-INFO --- old/simplejson-3.11.1/PKG-INFO 2017-06-19 22:11:30.000000000 +0200 +++ new/simplejson-3.12.0/PKG-INFO 2017-11-05 19:39:27.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: simplejson -Version: 3.11.1 +Version: 3.12.0 Summary: Simple, fast, extensible JSON encoder/decoder for Python Home-page: http://github.com/simplejson/simplejson Author: Bob Ippolito diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/conf.py new/simplejson-3.12.0/conf.py --- old/simplejson-3.11.1/conf.py 2017-06-19 22:11:11.000000000 +0200 +++ new/simplejson-3.12.0/conf.py 2017-11-05 19:26:48.000000000 +0100 @@ -42,9 +42,9 @@ # other places throughout the built documents. # # The short X.Y version. -version = '3.11' +version = '3.12' # The full version, including alpha/beta/rc tags. -release = '3.11.1' +release = '3.12.0' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/setup.py new/simplejson-3.12.0/setup.py --- old/simplejson-3.11.1/setup.py 2017-06-19 22:11:11.000000000 +0200 +++ new/simplejson-3.12.0/setup.py 2017-11-05 19:26:54.000000000 +0100 @@ -11,7 +11,7 @@ DistutilsPlatformError IS_PYPY = hasattr(sys, 'pypy_translation_info') -VERSION = '3.11.1' +VERSION = '3.12.0' DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python" with open('README.rst', 'r') as f: @@ -38,7 +38,7 @@ Topic :: Software Development :: Libraries :: Python Modules """.splitlines())) -if sys.platform == 'win32' and sys.version_info > (2, 6): +if sys.platform == 'win32' and sys.version_info < (2, 7): # 2.6's distutils.msvc9compiler can raise an IOError when failing to # find the compiler # It can also raise ValueError http://bugs.python.org/issue7511 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson/__init__.py new/simplejson-3.12.0/simplejson/__init__.py --- old/simplejson-3.11.1/simplejson/__init__.py 2017-06-19 22:11:11.000000000 +0200 +++ new/simplejson-3.12.0/simplejson/__init__.py 2017-11-05 19:26:34.000000000 +0100 @@ -97,20 +97,21 @@ Expecting property name: line 1 column 3 (char 2) """ from __future__ import absolute_import -__version__ = '3.11.1' +__version__ = '3.12.0' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', - 'OrderedDict', 'simple_first', + 'OrderedDict', 'simple_first', 'RawJSON' ] __author__ = 'Bob Ippolito <[email protected]>' from decimal import Decimal -from .scanner import JSONDecodeError +from .errors import JSONDecodeError +from .raw_json import RawJSON from .decoder import JSONDecoder -from .encoder import JSONEncoder, JSONEncoderForHTML, RawJSON +from .encoder import JSONEncoder, JSONEncoderForHTML def _import_OrderedDict(): import collections try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson/_speedups.c new/simplejson-3.12.0/simplejson/_speedups.c --- old/simplejson-3.11.1/simplejson/_speedups.c 2017-06-19 22:11:11.000000000 +0200 +++ new/simplejson-3.12.0/simplejson/_speedups.c 2017-11-05 19:23:11.000000000 +0100 @@ -263,17 +263,10 @@ #define MIN_EXPANSION 6 -static PyObject* RawJSONType; +static PyObject* RawJSONType = NULL; static int is_raw_json(PyObject *obj) { - if (RawJSONType == NULL) { - PyObject *encoder_module = PyImport_ImportModule("simplejson.encoder"); - RawJSONType = PyObject_GetAttrString(encoder_module, "RawJSON"); - Py_DECREF(encoder_module); - if (RawJSONType == NULL) - return 0; - } return PyObject_IsInstance(obj, RawJSONType) ? 1 : 0; } @@ -785,22 +778,12 @@ return NULL; } +/* Use JSONDecodeError exception to raise a nice looking ValueError subclass */ +static PyObject *JSONDecodeError = NULL; static void raise_errmsg(char *msg, PyObject *s, Py_ssize_t end) { - /* Use JSONDecodeError exception to raise a nice looking ValueError subclass */ - static PyObject *JSONDecodeError = NULL; - PyObject *exc; - if (JSONDecodeError == NULL) { - PyObject *scanner = PyImport_ImportModule("simplejson.scanner"); - if (scanner == NULL) - return; - JSONDecodeError = PyObject_GetAttrString(scanner, "JSONDecodeError"); - Py_DECREF(scanner); - if (JSONDecodeError == NULL) - return; - } - exc = PyObject_CallFunction(JSONDecodeError, "(zOO&)", msg, s, _convertPyInt_FromSsize_t, &end); + PyObject *exc = PyObject_CallFunction(JSONDecodeError, "(zOO&)", msg, s, _convertPyInt_FromSsize_t, &end); if (exc) { PyErr_SetObject(JSONDecodeError, exc); Py_DECREF(exc); @@ -3349,6 +3332,17 @@ }; #endif +PyObject * +import_dependency(char *module_name, char *attr_name) +{ + PyObject *module = PyImport_ImportModule(module_name); + if (module == NULL) + return NULL; + PyObject *rval = PyObject_GetAttrString(module, attr_name); + Py_DECREF(module); + return rval; +} + static PyObject * moduleinit(void) { @@ -3367,6 +3361,12 @@ PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType); Py_INCREF((PyObject*)&PyEncoderType); PyModule_AddObject(m, "make_encoder", (PyObject*)&PyEncoderType); + RawJSONType = import_dependency("simplejson.raw_json", "RawJSON"); + if (RawJSONType == NULL) + return NULL; + JSONDecodeError = import_dependency("simplejson.errors", "JSONDecodeError"); + if (JSONDecodeError == NULL) + return NULL; return m; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson/encoder.py new/simplejson-3.12.0/simplejson/encoder.py --- old/simplejson-3.11.1/simplejson/encoder.py 2017-06-19 20:13:33.000000000 +0200 +++ new/simplejson-3.12.0/simplejson/encoder.py 2017-11-05 19:06:14.000000000 +0100 @@ -14,7 +14,8 @@ return None, None c_encode_basestring_ascii, c_make_encoder = _import_speedups() -from simplejson.decoder import PosInf +from .decoder import PosInf +from .raw_json import RawJSON #ESCAPE = re.compile(ur'[\x00-\x1f\\"\b\f\n\r\t\u2028\u2029]') # This is required because u() will mangle the string and ur'' isn't valid @@ -39,14 +40,6 @@ FLOAT_REPR = repr -class RawJSON(object): - """Wrap an encoded JSON document for direct embedding in the output - - """ - def __init__(self, encoded_json): - self.encoded_json = encoded_json - - def encode_basestring(s, _PY3=PY3, _q=u('"')): """Return a JSON representation of a Python string diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson/errors.py new/simplejson-3.12.0/simplejson/errors.py --- old/simplejson-3.11.1/simplejson/errors.py 1970-01-01 01:00:00.000000000 +0100 +++ new/simplejson-3.12.0/simplejson/errors.py 2017-11-05 19:24:18.000000000 +0100 @@ -0,0 +1,53 @@ +"""Error classes used by simplejson +""" +__all__ = ['JSONDecodeError'] + + +def linecol(doc, pos): + lineno = doc.count('\n', 0, pos) + 1 + if lineno == 1: + colno = pos + 1 + else: + colno = pos - doc.rindex('\n', 0, pos) + return lineno, colno + + +def errmsg(msg, doc, pos, end=None): + lineno, colno = linecol(doc, pos) + msg = msg.replace('%r', repr(doc[pos:pos + 1])) + if end is None: + fmt = '%s: line %d column %d (char %d)' + return fmt % (msg, lineno, colno, pos) + endlineno, endcolno = linecol(doc, end) + fmt = '%s: line %d column %d - line %d column %d (char %d - %d)' + return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end) + + +class JSONDecodeError(ValueError): + """Subclass of ValueError with the following additional properties: + + msg: The unformatted error message + doc: The JSON document being parsed + pos: The start index of doc where parsing failed + end: The end index of doc where parsing failed (may be None) + lineno: The line corresponding to pos + colno: The column corresponding to pos + endlineno: The line corresponding to end (may be None) + endcolno: The column corresponding to end (may be None) + + """ + # Note that this exception is used from _speedups + def __init__(self, msg, doc, pos, end=None): + ValueError.__init__(self, errmsg(msg, doc, pos, end=end)) + self.msg = msg + self.doc = doc + self.pos = pos + self.end = end + self.lineno, self.colno = linecol(doc, pos) + if end is not None: + self.endlineno, self.endcolno = linecol(doc, end) + else: + self.endlineno, self.endcolno = None, None + + def __reduce__(self): + return self.__class__, (self.msg, self.doc, self.pos, self.end) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson/raw_json.py new/simplejson-3.12.0/simplejson/raw_json.py --- old/simplejson-3.11.1/simplejson/raw_json.py 1970-01-01 01:00:00.000000000 +0100 +++ new/simplejson-3.12.0/simplejson/raw_json.py 2017-11-05 19:06:29.000000000 +0100 @@ -0,0 +1,9 @@ +"""Implementation of RawJSON +""" + +class RawJSON(object): + """Wrap an encoded JSON document for direct embedding in the output + + """ + def __init__(self, encoded_json): + self.encoded_json = encoded_json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson/scanner.py new/simplejson-3.12.0/simplejson/scanner.py --- old/simplejson-3.11.1/simplejson/scanner.py 2014-07-22 22:30:14.000000000 +0200 +++ new/simplejson-3.12.0/simplejson/scanner.py 2017-11-05 19:24:42.000000000 +0100 @@ -1,9 +1,10 @@ """JSON token scanner """ import re +from .errors import JSONDecodeError def _import_c_make_scanner(): try: - from simplejson._speedups import make_scanner + from ._speedups import make_scanner return make_scanner except ImportError: return None @@ -15,55 +16,6 @@ r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) -class JSONDecodeError(ValueError): - """Subclass of ValueError with the following additional properties: - - msg: The unformatted error message - doc: The JSON document being parsed - pos: The start index of doc where parsing failed - end: The end index of doc where parsing failed (may be None) - lineno: The line corresponding to pos - colno: The column corresponding to pos - endlineno: The line corresponding to end (may be None) - endcolno: The column corresponding to end (may be None) - - """ - # Note that this exception is used from _speedups - def __init__(self, msg, doc, pos, end=None): - ValueError.__init__(self, errmsg(msg, doc, pos, end=end)) - self.msg = msg - self.doc = doc - self.pos = pos - self.end = end - self.lineno, self.colno = linecol(doc, pos) - if end is not None: - self.endlineno, self.endcolno = linecol(doc, end) - else: - self.endlineno, self.endcolno = None, None - - def __reduce__(self): - return self.__class__, (self.msg, self.doc, self.pos, self.end) - - -def linecol(doc, pos): - lineno = doc.count('\n', 0, pos) + 1 - if lineno == 1: - colno = pos + 1 - else: - colno = pos - doc.rindex('\n', 0, pos) - return lineno, colno - - -def errmsg(msg, doc, pos, end=None): - lineno, colno = linecol(doc, pos) - msg = msg.replace('%r', repr(doc[pos:pos + 1])) - if end is None: - fmt = '%s: line %d column %d (char %d)' - return fmt % (msg, lineno, colno, pos) - endlineno, endcolno = linecol(doc, end) - fmt = '%s: line %d column %d - line %d column %d (char %d - %d)' - return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end) - def py_make_scanner(context): parse_object = context.parse_object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson.egg-info/PKG-INFO new/simplejson-3.12.0/simplejson.egg-info/PKG-INFO --- old/simplejson-3.11.1/simplejson.egg-info/PKG-INFO 2017-06-19 22:11:29.000000000 +0200 +++ new/simplejson-3.12.0/simplejson.egg-info/PKG-INFO 2017-11-05 19:39:26.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: simplejson -Version: 3.11.1 +Version: 3.12.0 Summary: Simple, fast, extensible JSON encoder/decoder for Python Home-page: http://github.com/simplejson/simplejson Author: Bob Ippolito diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simplejson-3.11.1/simplejson.egg-info/SOURCES.txt new/simplejson-3.12.0/simplejson.egg-info/SOURCES.txt --- old/simplejson-3.11.1/simplejson.egg-info/SOURCES.txt 2017-06-19 22:11:29.000000000 +0200 +++ new/simplejson-3.12.0/simplejson.egg-info/SOURCES.txt 2017-11-05 19:39:26.000000000 +0100 @@ -12,7 +12,9 @@ simplejson/compat.py simplejson/decoder.py simplejson/encoder.py +simplejson/errors.py simplejson/ordered_dict.py +simplejson/raw_json.py simplejson/scanner.py simplejson/tool.py simplejson.egg-info/PKG-INFO
