pkgsrc-Changes archive

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

CVS commit: pkgsrc/geography/py-maxminddb



Module Name:    pkgsrc
Committed By:   adam
Date:           Wed Nov 18 08:44:28 UTC 2026

Modified Files:
        pkgsrc/geography/py-maxminddb: Makefile distinfo

Log Message:
py-maxminddb: updated to 3.3.0

3.3.0 (2026-11-17)

* Fixed iteration over an IPv6 database with a network shorter than /96
  whose first bits are zero, such as ``::/1``. The readers raised
  ``ValueError`` or skipped networks. The pure Python reader also raised
  ``ValueError`` for a network that starts at ``::1:0:0``, such as
  ``::1:0:0/96``.
* The pure Python reader now raises ``InvalidDatabaseError`` for a search tree
  record that points before the data section. Previously, it returned an
  empty map.
* Iterating over a database with a corrupt search tree, such as one with a
  cycle, now raises ``InvalidDatabaseError``. Previously, the C extension
  could corrupt memory, and the pure Python reader raised ``RecursionError``
  or returned part of the networks.
* A second ``__init__`` on a pure Python ``Reader`` now closes the old
  database, and an iterator from before it raises ``ValueError``, as in the
  C extension. Before, the iterator walked the new database with node
  numbers from the old one. A failed ``__init__`` keeps the old database.
  After ``close()``, an iterator raises ``ValueError`` in every mode.
* The pure Python reader now raises ``InvalidDatabaseError`` when a value,
  search tree record or pointer goes past the end of the data section, or when
  the search tree overlaps the metadata. Previously, it could return a shorter
  or wrong value, or decode bytes from the metadata section.
* The pure Python reader now raises ``InvalidDatabaseError`` when a record map
  key is not a string, as the C extension does. Previously, it returned the
  non-string key or raised ``TypeError``.
* The pure Python reader now raises ``InvalidDatabaseError`` for extended type
  byte 0. Previously, it decoded the value as a map. The C extension still
  decodes it as a map, because libmaxminddb does not check this byte.
* An empty database file now raises ``InvalidDatabaseError`` in ``MODE_FILE``,
  as in ``MODE_MEMORY``. Previously, it raised ``OSError`` on platforms with
  ``os.pread``.
* C extension:

  * Fixed segmentation faults from invalid use of ``Metadata``, ``Reader`` and
    the internal iterator type.
  * Fixed a segmentation fault on a database with a map key that is not a
    string. Such a database now raises ``InvalidDatabaseError``.
  * Fixed large ``uint32`` values, which came back negative on platforms
    with a 32-bit C ``long``, such as Windows.
  * Fixed memory leaks and a use-after-free. A second ``__init__`` on a
    ``Reader`` now closes the old database, and an iterator from before it
    raises ``ValueError``. A failed ``__init__`` keeps the old database.
    Reinitializing a ``Metadata`` changes nothing.
  * Fixed a ``RuntimeWarning`` or ``RuntimeError`` on free-threaded Python on
    macOS when a ``Reader`` failed to open or was used without ``__init__``.
  * Fixed a deadlock on free-threaded Python when a ``Reader`` was closed
    during iteration, from another thread or from a signal handler.
  * Fixed a crash on free-threaded Python when two threads advanced the same
    iterator.
  * An exhausted iterator now raises ``StopIteration`` after its ``Reader``
    closes, not ``ValueError``.
  * The iterator now stops after an error, as the pure Python iterator does.
    This includes an error in the data of one record, but not a failure to
    get the read lock. Previously, the next call returned the remaining
    networks.
  * Added the ``node_byte_size`` and ``search_tree_size`` properties to
    ``Metadata``, as the pure Python ``Metadata`` has.

* Metadata:

  * The pure Python reader ignores unknown keys, which a new minor version of
    the format can add, if their values decode. Previously, an unknown key
    raised ``TypeError``. It raises ``InvalidDatabaseError`` for a missing key,
    a key that is not a string, a value that is not of the expected Python
    type or is out of range, an invalid ``ip_version`` or format version, a
    ``build_epoch`` of 0, or a string that is not UTF-8 anywhere in the
    metadata. Previously, the reader opened most of these files, and some
    raised ``TypeError`` or ``UnicodeDecodeError``.
  * The C extension ignores unknown keys unless a value cannot be decoded,
    such as a map with a key that is not a string. Previously,
    ``Reader.metadata()`` crashed with a segmentation fault on any unknown
    key.
  * For a metadata string that is not UTF-8, the ``InvalidDatabaseError``
    from the C ``Reader.metadata()`` has the ``UnicodeDecodeError`` as its
    cause.

* Added ``maxminddb.Mode``, which the README already described.
* Type checkers now reject a subscript of ``maxminddb.types.Record`` or
  ``Primitive``, such as ``Record[str]``. The subscript still works at
  runtime. Pull request by Adam Hitchcock.

* Type hints:

  * ``Primitive`` includes ``bytearray``, which the C extension returns for
    the ``bytes`` type.
  * ``Reader.__iter__`` declares its item type.
  * Added the ``StrOrBytesPath`` and ``DatabaseSource`` aliases to
    ``maxminddb.types``.
  * The ``maxminddb.extension.Reader`` stub accepts only a path, as the
    extension does.
  * ``MODE_FD`` accepts any object whose ``read()`` method returns ``bytes``,
    such as a ``gzip.GzipFile``. ``maxminddb.types.SupportsRead`` describes
    this type.

* ``MODE_AUTO`` now accepts a binary file object. Previously, it raised
  ``TypeError``. It reads the file object into memory with the pure Python
  reader, as ``MODE_FD`` does. The C extension needs a path, so lookups are
  slower than with a path when the extension is installed.
* The pure Python reader raises ``TypeError`` when the database argument does
  not suit the mode.
* Updated the vendored libmaxminddb to 1.14.1. This fixes a build failure
  with ``-Werror`` on platforms where ``ssize_t`` is 32 bits, such as i686.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/geography/py-maxminddb/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/geography/py-maxminddb/distinfo

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

Modified files:

Index: pkgsrc/geography/py-maxminddb/Makefile
diff -u pkgsrc/geography/py-maxminddb/Makefile:1.14 pkgsrc/geography/py-maxminddb/Makefile:1.15
--- pkgsrc/geography/py-maxminddb/Makefile:1.14 Fri Mar  6 06:22:39 2026
+++ pkgsrc/geography/py-maxminddb/Makefile      Wed Nov 18 08:44:28 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.14 2026/03/06 06:22:39 adam Exp $
+# $NetBSD: Makefile,v 1.15 2026/11/18 08:44:28 adam Exp $
 
-DISTNAME=      maxminddb-3.1.1
+DISTNAME=      maxminddb-3.3.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    geography python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=m/maxminddb/}
@@ -11,7 +11,7 @@ COMMENT=      Reader for the MaxMind DB forma
 LICENSE=       apache-2.0
 
 TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools>=78:../../devel/py-setuptools
-TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools_scm-[0-9]*:../../devel/py-setuptools_scm
+TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools_scm>=0:../../devel/py-setuptools_scm
 
 MAKE_ENV+=     MAXMINDDB_USE_SYSTEM_LIBMAXMINDDB=1
 

Index: pkgsrc/geography/py-maxminddb/distinfo
diff -u pkgsrc/geography/py-maxminddb/distinfo:1.10 pkgsrc/geography/py-maxminddb/distinfo:1.11
--- pkgsrc/geography/py-maxminddb/distinfo:1.10 Fri Mar  6 06:22:39 2026
+++ pkgsrc/geography/py-maxminddb/distinfo      Wed Nov 18 08:44:28 2026
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.10 2026/03/06 06:22:39 adam Exp $
+$NetBSD: distinfo,v 1.11 2026/11/18 08:44:28 adam Exp $
 
-BLAKE2s (maxminddb-3.1.1.tar.gz) = e594b28216ad25e252ca3a4314741c3907569a8418231d15b8835e273f5dff26
-SHA512 (maxminddb-3.1.1.tar.gz) = 21a5cbe039395afbdf6a313446ad67af5fc216f32509647cf6c07b7d35f85b251ea44d43e831329730acbdda22ed0db59cefd515c24be773b6f84d6fe710ae3e
-Size (maxminddb-3.1.1.tar.gz) = 212410 bytes
+BLAKE2s (maxminddb-3.3.0.tar.gz) = e045fb52b8c6fdfa7da2e76c0ba72065fe28d135dc9b386ca5a9e5a8695ee18e
+SHA512 (maxminddb-3.3.0.tar.gz) = a6e1f81cbc657a99b375ca78ab98b71b82df96068c69d31897ee1251cffad72bca63dcddb744df024ed087e6dad7f9624497190853ef83c4686d4531e1e5dfa3
+Size (maxminddb-3.3.0.tar.gz) = 548167 bytes



Home | Main Index | Thread Index | Old Index