Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-python-rapidjson for 
openSUSE:Factory checked in at 2026-04-04 19:07:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-rapidjson (Old)
 and      /work/SRC/openSUSE:Factory/.python-python-rapidjson.new.21863 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-python-rapidjson"

Sat Apr  4 19:07:41 2026 rev:16 rq:1344515 version:1.23

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-python-rapidjson/python-python-rapidjson.changes
  2025-11-25 17:19:02.784110911 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-python-rapidjson.new.21863/python-python-rapidjson.changes
       2026-04-04 19:09:32.982370513 +0200
@@ -1,0 +2,7 @@
+Fri Apr  3 17:58:04 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 1.23:
+  * Fix serialization bug when using MM_COERCE_KEYS_TO_STRINGS
+    together with sort_keys=True (issue #229)
+
+-------------------------------------------------------------------

Old:
----
  python-rapidjson-1.22.tar.gz

New:
----
  python-rapidjson-1.23.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-python-rapidjson.spec ++++++
--- /var/tmp/diff_new_pack.walIma/_old  2026-04-04 19:09:33.586395278 +0200
+++ /var/tmp/diff_new_pack.walIma/_new  2026-04-04 19:09:33.590395442 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-python-rapidjson
 #
-# Copyright (c) 2025 SUSE LLC and contributors
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 %define rjversion 1.1.0+git20211015.4d6cb081
 %{?sle15_python_module_pythons}
 Name:           python-python-rapidjson
-Version:        1.22
+Version:        1.23
 Release:        0
 Summary:        Python wrapper around rapidjson
 License:        MIT

++++++ python-rapidjson-1.22.tar.gz -> python-rapidjson-1.23.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-rapidjson-1.22/.bumpversion.toml 
new/python-rapidjson-1.23/.bumpversion.toml
--- old/python-rapidjson-1.22/.bumpversion.toml 2025-10-21 08:01:31.000000000 
+0200
+++ new/python-rapidjson-1.23/.bumpversion.toml 2025-12-07 07:14:13.000000000 
+0100
@@ -7,7 +7,7 @@
 #
 
 [tool.bumpversion]
-current_version = "1.22"
+current_version = "1.23"
 parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)"
 serialize = [
     "{major}.{minor}",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-rapidjson-1.22/CHANGES.rst 
new/python-rapidjson-1.23/CHANGES.rst
--- old/python-rapidjson-1.22/CHANGES.rst       2025-10-21 08:01:31.000000000 
+0200
+++ new/python-rapidjson-1.23/CHANGES.rst       2025-12-07 07:14:13.000000000 
+0100
@@ -1,6 +1,15 @@
 Changes
 -------
 
+1.23 (2025-12-07)
+~~~~~~~~~~~~~~~~~
+
+* Fix serialization bug when using ``MM_COERCE_KEYS_TO_STRINGS`` together with
+  ``sort_keys=True`` (`issue #229`__)
+
+  __ https://github.com/python-rapidjson/python-rapidjson/issues/229
+
+
 1.22 (2025-10-21)
 ~~~~~~~~~~~~~~~~~
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-rapidjson-1.22/rapidjson.cpp 
new/python-rapidjson-1.23/rapidjson.cpp
--- old/python-rapidjson-1.22/rapidjson.cpp     2025-10-21 08:01:31.000000000 
+0200
+++ new/python-rapidjson-1.23/rapidjson.cpp     2025-12-07 07:14:13.000000000 
+0100
@@ -3,7 +3,7 @@
 // :Author:    Ken Robbins <[email protected]>
 // :License:   MIT License
 // :Copyright: © 2015 Ken Robbins
-// :Copyright: © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 
Lele Gaifax
+// :Copyright: © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 
2025 Lele Gaifax
 //
 
 #include <locale.h>
@@ -2297,23 +2297,17 @@
 
 
 struct DictItem {
-    const char* key_str;
-    Py_ssize_t key_size;
-    PyObject* item;
-
-    DictItem(const char* k,
-             Py_ssize_t s,
-             PyObject* i)
-        : key_str(k),
-          key_size(s),
-          item(i)
+    std::string key;
+    PyObject* value;
+
+    DictItem(std::string k,
+             PyObject* v)
+        : key(k),
+          value(v)
         {}
 
     bool operator<(const DictItem& other) const {
-        Py_ssize_t tks = this->key_size;
-        Py_ssize_t oks = other.key_size;
-        int cmp = strncmp(this->key_str, other.key_str, tks < oks ? tks : oks);
-        return (cmp == 0) ? (tks < oks) : (cmp < 0);
+        return key < other.key;
     }
 };
 
@@ -2613,7 +2607,7 @@
                         return false;
                     }
                     ASSERT_VALID_SIZE(l);
-                    items.push_back(DictItem(key_str, l, item));
+                    items.push_back(DictItem(std::string(key_str, l), item));
                 } else if (!(mappingMode & MM_SKIP_NON_STRING_KEYS)) {
                     PyErr_SetString(PyExc_TypeError, "keys must be strings");
                     assert(!coercedKey);
@@ -2625,10 +2619,10 @@
             std::sort(items.begin(), items.end());
 
             for (size_t i=0, s=items.size(); i < s; i++) {
-                writer->Key(items[i].key_str, (SizeType) items[i].key_size);
+                writer->Key(items[i].key.c_str(), (SizeType) 
items[i].key.length());
                 if (Py_EnterRecursiveCall(" while JSONifying dict object"))
                     return false;
-                bool r = RECURSE(items[i].item);
+                bool r = RECURSE(items[i].value);
                 Py_LeaveRecursiveCall();
                 if (!r)
                     return false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-rapidjson-1.22/setup.py 
new/python-rapidjson-1.23/setup.py
--- old/python-rapidjson-1.22/setup.py  2025-10-21 08:01:31.000000000 +0200
+++ new/python-rapidjson-1.23/setup.py  2025-12-07 07:14:13.000000000 +0100
@@ -44,7 +44,7 @@
                            " want to report the issue.")
 
 # Automatically updated by bump-my-version at release time
-VERSION = '1.22'
+VERSION = '1.23'
 
 with open('README.rst', encoding='utf-8') as f:
     LONG_DESCRIPTION = f.read()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-rapidjson-1.22/tests/test_params.py 
new/python-rapidjson-1.23/tests/test_params.py
--- old/python-rapidjson-1.22/tests/test_params.py      2025-10-21 
08:01:31.000000000 +0200
+++ new/python-rapidjson-1.23/tests/test_params.py      2025-12-07 
07:14:13.000000000 +0100
@@ -3,7 +3,7 @@
 # :Author:    Ken Robbins <[email protected]>
 # :License:   MIT License
 # :Copyright: © 2015 Ken Robbins
-# :Copyright: © 2015, 2016, 2017, 2018, 2019, 2020 Lele Gaifax
+# :Copyright: © 2015, 2016, 2017, 2018, 2019, 2020, 2025 Lele Gaifax
 #
 
 from calendar import timegm
@@ -217,6 +217,17 @@
     assert dumps(o, sort_keys=True) == 
'{"a":"a","a\\u0000b":"a\\u0000b","a0":"a0","a1":"a1"}'
 
 
+def test_sort_and_coerce_keys(dumps):
+    # Issue 229
+    o = {"a": 1, 3: 4.5, date(2025,10,10): 2, date(2025,11,11): 3}
+    expected = '{"2025-10-10":2,"2025-11-11":3,"3":4.5,"a":1}'
+    assert dumps(o, sort_keys=True, mapping_mode=rj.MM_COERCE_KEYS_TO_STRINGS) 
== expected
+
+    o = {"ab": 3, "a": 1, "a\x00b": 2}
+    expected = '{"a":1,"a\\u0000b":2,"ab":3}'
+    assert dumps(o, sort_keys=True, mapping_mode=rj.MM_COERCE_KEYS_TO_STRINGS) 
== expected
+
+
 def test_default():
     class Bar:
         pass

++++++ rapidjson-system.patch ++++++
--- /var/tmp/diff_new_pack.walIma/_old  2026-04-04 19:09:33.906408398 +0200
+++ /var/tmp/diff_new_pack.walIma/_new  2026-04-04 19:09:33.906408398 +0200
@@ -1,7 +1,7 @@
-Index: python-rapidjson-1.22/setup.py
+Index: python-rapidjson-1.23/setup.py
 ===================================================================
---- python-rapidjson-1.22.orig/setup.py
-+++ python-rapidjson-1.22/setup.py
+--- python-rapidjson-1.23.orig/setup.py
++++ python-rapidjson-1.23/setup.py
 @@ -29,19 +29,7 @@ if sys.version_info < (3, 6):
  
  ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
@@ -22,5 +22,5 @@
 +rj_include_dir = '/usr/include/rapidjson'
  
  # Automatically updated by bump-my-version at release time
- VERSION = '1.22'
+ VERSION = '1.23'
 

Reply via email to