pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/databases/py-multidict



Module Name:    pkgsrc
Committed By:   adam
Date:           Thu Sep 10 11:21:25 UTC 2026

Modified Files:
        pkgsrc/databases/py-multidict: Makefile distinfo

Log Message:
py-multidict: updated to 6.8.0

6.8.0

Bug fixes

- A segmentation fault that could be triggered when getting an item is now fixed

- Fixed reference leak in iterators, views and ``istr``

- Fixed the pure-Python :class:`~multidict.MultiDict` constructor and
  :py:meth:`~multidict.MultiDict.extend`,
  :py:meth:`~multidict.MultiDict.update`, and
  :py:meth:`~multidict.MultiDict.merge` methods over-allocating their
  internal hash table when called with both a positional argument and
  keyword arguments, because keyword arguments were counted twice in the
  size estimate

- Fixed ``__repr__`` of :class:`~multidict.MultiDict`,
  :class:`~multidict.CIMultiDict`, their proxies, and the keys/items views
  producing invalid output when keys contained quote characters --
  keys are now formatted with :func:`repr` so the result is a valid Python
  string literal

- Fixed a segfault when calling :py:meth:`~multidict.MultiDict.add` with only one of its two required arguments supplied by keyword, e.g. ``d.add(key="k")``. Extra keyword arguments passed to the 
lookup and removal methods are also now rejected with :exc:`TypeError` instead of being silently ignored.

- Fixed a segfault when constructing a multidict iterator type directly, e.g. ``type(iter(md.keys())).__new__(...)``. Such an iterator had a NULL internal pointer that ``next()`` dereferenced. The 
iterator types now forbid direct instantiation, the same way the view types were fixed in :issue:`1163`.

- Fixed a segfault when using a :py:class:`~multidict.MultiDict` or :py:class:`~multidict.CIMultiDict` created via ``__new__`` without calling ``__init__`` (for example a subclass that does not call 
``super().__init__()``). The internal state was left as NULL pointers that the first method call dereferenced. ``tp_new`` now initializes the object to a valid empty mapping.

- Fixed two crashes in the C extension caused by holding a raw pointer into a hash table across an operation that could reshape it. Updating a multidict from itself (e.g. ``d.extend(d)``) freed the 
very table being iterated -- a use-after-free; ``extend(self)`` now doubles the contents and ``update(self)``/``merge(self)`` are no-ops. Building a multidict from a list of pairs whose 
case-insensitive key ``.lower()`` shrinks that list read past the end of the list; the length is now re-checked on every iteration.

- Fixed three reference/resource leaks on error paths in the C extension: the items-view ``__contains__`` leaked the first element of a candidate pair when reading the second one raised; ``__repr__`` 
leaked its ``PyUnicodeWriter`` when the multidict was mutated during iteration; and the internal iteration helper leaked the identity reference when key materialization failed under low memory.

- Stopped several feature-detection fallbacks in the C extension from swallowing every exception. When probing an argument (``arg.items()``/``arg.keys()``) or measuring it (``len(other)``) fails, the 
code now clears only the expected :exc:`TypeError`/:exc:`AttributeError` and lets everything else -- notably :exc:`MemoryError` and :exc:`KeyboardInterrupt` -- propagate, matching the already-correct 
sites elsewhere in the module.

- Fixed a segmentation fault when extending a multidict with itself

- Fixed a memory leak when ``MultiDict`` and ``CIMultiDict`` instances are
  initialized more than once

- Fixed a reference leak in items-view set operations

- Fixed a memory leak when destroying C-extension multidict instances
  and proxies

- Fixed a reference leak from repeated ``__init__`` calls on
  ``MultiDictProxy`` and ``CIMultiDictProxy`` instances

- Fixed missing decref for :data:`None` on error in :meth:`~multidict.MultiDict.setdefault`

Features

- Added :py:func:`reversed` support to the keys, values, and items views of
  :class:`~multidict.MultiDict`, :class:`~multidict.CIMultiDict`, and their
  proxies in both the C-extension and pure-Python implementations

- Optimized key identity comparison for C Extension.

  Now it uses fast path that is equal to :c:func:`PyUnicode_Equal` from
  Python 3.14+ but without redundant type checks. It gives ~15% speed-up on benchmarks with many key comparisons.

- Changed both the pure-Python and C implementations to mark a temporarily
  removed hash table entry by setting the high bit of its hash instead of
  overwriting it with a sentinel value, so restoring the entry no longer
  recomputes the hash; :meth:`~multidict.MultiDict.getall` is faster ~10% now in C version


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 pkgsrc/databases/py-multidict/Makefile
cvs rdiff -u -r1.39 -r1.40 pkgsrc/databases/py-multidict/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/databases/py-multidict/Makefile
diff -u pkgsrc/databases/py-multidict/Makefile:1.43 pkgsrc/databases/py-multidict/Makefile:1.44
--- pkgsrc/databases/py-multidict/Makefile:1.43 Sun Jun 28 15:41:11 2026
+++ pkgsrc/databases/py-multidict/Makefile      Thu Sep 10 11:21:25 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.43 2026/06/28 15:41:11 wiz Exp $
+# $NetBSD: Makefile,v 1.44 2026/09/10 11:21:25 adam Exp $
 
-DISTNAME=      multidict-6.7.1
+DISTNAME=      multidict-6.8.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    databases python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=m/multidict/}
@@ -11,10 +11,10 @@ COMMENT=    Multidict implementation
 LICENSE=       apache-2.0
 
 TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools>=78:../../devel/py-setuptools
-TEST_DEPENDS+= ${PYPKGPREFIX}-objgraph-[0-9]*:../../graphics/py-objgraph
-TEST_DEPENDS+= ${PYPKGPREFIX}-psutil-[0-9]*:../../sysutils/py-psutil
-TEST_DEPENDS+= ${PYPKGPREFIX}-test-codspeed-[0-9]*:../../devel/py-test-codspeed
-TEST_DEPENDS+= ${PYPKGPREFIX}-test-cov-[0-9]*:../../devel/py-test-cov
+TEST_DEPENDS+= ${PYPKGPREFIX}-objgraph>=3.6.2:../../graphics/py-objgraph
+TEST_DEPENDS+= ${PYPKGPREFIX}-psutil>=7.2.2:../../sysutils/py-psutil
+TEST_DEPENDS+= ${PYPKGPREFIX}-test-codspeed>=5.0.3:../../devel/py-test-codspeed
+TEST_DEPENDS+= ${PYPKGPREFIX}-test-cov>=7.1.0:../../devel/py-test-cov
 
 PYTHON_VERSIONS_INCOMPATIBLE=  310 311
 

Index: pkgsrc/databases/py-multidict/distinfo
diff -u pkgsrc/databases/py-multidict/distinfo:1.39 pkgsrc/databases/py-multidict/distinfo:1.40
--- pkgsrc/databases/py-multidict/distinfo:1.39 Mon Jan 26 09:13:18 2026
+++ pkgsrc/databases/py-multidict/distinfo      Thu Sep 10 11:21:25 2026
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.39 2026/01/26 09:13:18 adam Exp $
+$NetBSD: distinfo,v 1.40 2026/09/10 11:21:25 adam Exp $
 
-BLAKE2s (multidict-6.7.1.tar.gz) = 952940ebb50b25b211dea5d4371a4436986617d713b3cf3b3572958a0777b78e
-SHA512 (multidict-6.7.1.tar.gz) = 9da26d479ea5464e6464988ff5d1ba3efa2890c7b400d013e23f5757f803dca8d74c0225c14d405fadfcb5047f5bb3fb2c2d3370848f33a6e1441d43ff86253d
-Size (multidict-6.7.1.tar.gz) = 102010 bytes
+BLAKE2s (multidict-6.8.0.tar.gz) = 36eb3ef2ada5106790c624ec4774a10ace7c693e6b6f05f3b2da7f0dbca07a45
+SHA512 (multidict-6.8.0.tar.gz) = 434a5dcbee201ca705947943c8645f784d1c211836b6511c5b096b9b9cf181335e1d7015bfd91b8d4c11481e7d81d64f2363214c41f3d051fb7e202be128e383
+Size (multidict-6.8.0.tar.gz) = 122412 bytes
+SHA1 (patch-setup.py) = d170d71c292bb5ae48e3f38e08ef70880f8499a4



Home | Main Index | Thread Index | Old Index