File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,16 @@ The module will return an ``InvalidDatabaseError`` if the database is corrupt
9494or otherwise invalid. A ``ValueError `` will be thrown if you look up an
9595invalid IP address or an IPv6 address in an IPv4 database.
9696
97+ Thread Safety
98+ -------------
99+
100+ Both the C extension and pure Python implementations are safe for concurrent
101+ reads and support Python 3.13+ free-threading. The C extension provides
102+ free-threading support on platforms with pthread support (such as Linux and
103+ macOS) and Windows. On other platforms, the extension will use GIL-based
104+ protection. Calling ``close() `` while reads are in progress may cause
105+ exceptions in those threads.
106+
97107Requirements
98108------------
99109
Original file line number Diff line number Diff line change @@ -288,7 +288,10 @@ def _load_buffer(
288288 return filename
289289
290290 def close (self ) -> None :
291- """Close the MaxMind DB file and returns the resources to the system."""
291+ """Close the MaxMind DB file and returns the resources to the system.
292+
293+ Calling this method while reads are in progress may cause exceptions.
294+ """
292295 with contextlib .suppress (AttributeError ):
293296 self ._buffer .close () # type: ignore[union-attr]
294297
You can’t perform that action at this time.
0 commit comments