@@ -40,10 +40,10 @@ provide `free GeoLite2 databases
4040<http://dev.maxmind.com/geoip/geoip2/geolite2> `_. These files must be
4141decompressed with ``gunzip ``.
4242
43- After you have obtained a database and importing the module, call
44- ``open_database `` with a path to the database as the first argument.
45- Optionally, you may pass a mode as the second argument. The modes are
46- exported from ``maxminddb ``. Valid modes are:
43+ After you have obtained a database and imported the module, call
44+ ``open_database `` with a path, or file descriptor (in the case of MODE_FD),
45+ to the database as the first argument. Optionally, you may pass a mode as the
46+ second argument. The modes are exported from ``maxminddb ``. Valid modes are:
4747
4848* MODE_MMAP_EXT - use the C extension with memory map.
4949* MODE_MMAP - read from memory map. Pure Python.
@@ -52,6 +52,10 @@ exported from ``maxminddb``. Valid modes are:
5252* MODE_FD - load database into memory from a file descriptor. Pure Python.
5353* MODE_AUTO - try MODE_MMAP_EXT, MODE_MMAP, MODE_FILE in that order. Default.
5454
55+ **NOTE **: When using ``MODE_FD ``, it is the *caller's * responsibility to be
56+ sure that the file descriptor gets closed properly, even though this module
57+ *may * close it after the ``Reader `` object is created.
58+
5559The ``open_database `` function returns a ``Reader `` object. To look up an IP
5660address, use the ``get `` method on this object. The method will return the
5761corresponding values for the IP address from the database (e.g., a dictionary
0 commit comments