Hello community, here is the log from the commit of package python-maxminddb for openSUSE:Factory checked in at 2020-01-16 18:13:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-maxminddb (Old) and /work/SRC/openSUSE:Factory/.python-maxminddb.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-maxminddb" Thu Jan 16 18:13:12 2020 rev:5 rq:761128 version:1.5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-maxminddb/python-maxminddb.changes 2019-11-04 17:05:20.560192943 +0100 +++ /work/SRC/openSUSE:Factory/.python-maxminddb.new.26092/python-maxminddb.changes 2020-01-16 18:13:14.844703519 +0100 @@ -1,0 +2,6 @@ +Wed Jan 1 11:06:52 UTC 2020 - Sebastian Wagner <sebix+novell....@sebix.at> + +- update to version 1.5.2: + - Minor performance improvements in the pure Python reader. + +------------------------------------------------------------------- Old: ---- maxminddb-1.5.1.tar.gz New: ---- maxminddb-1.5.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-maxminddb.spec ++++++ --- /var/tmp/diff_new_pack.oPkTng/_old 2020-01-16 18:13:15.392703829 +0100 +++ /var/tmp/diff_new_pack.oPkTng/_new 2020-01-16 18:13:15.392703829 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-maxminddb # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-maxminddb -Version: 1.5.1 +Version: 1.5.2 Release: 0 Summary: Reader for the MaxMind DB format License: Apache-2.0 ++++++ maxminddb-1.5.1.tar.gz -> maxminddb-1.5.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/HISTORY.rst new/maxminddb-1.5.2/HISTORY.rst --- old/maxminddb-1.5.1/HISTORY.rst 2019-09-27 22:56:02.000000000 +0200 +++ new/maxminddb-1.5.2/HISTORY.rst 2019-12-20 19:42:54.000000000 +0100 @@ -3,6 +3,11 @@ History ------- +1.5.2 (2019-12-20) +++++++++++++++++++ + +* Minor performance improvements in the pure Python reader. + 1.5.1 (2019-09-27) ++++++++++++++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/PKG-INFO new/maxminddb-1.5.2/PKG-INFO --- old/maxminddb-1.5.1/PKG-INFO 2019-09-27 23:12:48.000000000 +0200 +++ new/maxminddb-1.5.2/PKG-INFO 2019-12-20 19:44:00.401256000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: maxminddb -Version: 1.5.1 +Version: 1.5.2 Summary: Reader for the MaxMind DB format Home-page: http://www.maxmind.com/ Author: Gregory Oschwald diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/.buildinfo new/maxminddb-1.5.2/docs/html/.buildinfo --- old/maxminddb-1.5.1/docs/html/.buildinfo 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/.buildinfo 2019-12-20 19:44:00.000000000 +0100 @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: ecfe08bc9a986f3303b79dd022312589 +config: f4b35ba4b456e07a1fe93fc0f298d57b tags: 645f666f9bcd5a90fca523b33c5a78b7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/_static/basic.css new/maxminddb-1.5.2/docs/html/_static/basic.css --- old/maxminddb-1.5.1/docs/html/_static/basic.css 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/_static/basic.css 2019-12-20 19:44:00.000000000 +0100 @@ -672,6 +672,10 @@ margin-top: 0; } +div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; +} + div.code-block-caption span.caption-number { padding: 0.1em 0.3em; font-style: italic; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/_static/documentation_options.js new/maxminddb-1.5.2/docs/html/_static/documentation_options.js --- old/maxminddb-1.5.1/docs/html/_static/documentation_options.js 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/_static/documentation_options.js 2019-12-20 19:44:00.000000000 +0100 @@ -1,8 +1,9 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '1.5.1', + VERSION: '1.5.2', LANGUAGE: 'None', COLLAPSE_INDEX: false, + BUILDER: 'html', FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/_static/searchtools.js new/maxminddb-1.5.2/docs/html/_static/searchtools.js --- old/maxminddb-1.5.1/docs/html/_static/searchtools.js 2019-09-27 21:45:54.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/_static/searchtools.js 2019-12-20 19:41:55.000000000 +0100 @@ -245,7 +245,7 @@ if (results.length) { var item = results.pop(); var listItem = $('<li style="display:none"></li>'); - if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') { + if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { // dirhtml builder var dirname = item[0] + '/'; if (dirname.match(/\/index\/$/)) { @@ -424,7 +424,7 @@ for (j = 0; j < _files.length; j++) { file = _files[j]; if (!(file in scoreMap)) - scoreMap[file] = {} + scoreMap[file] = {}; scoreMap[file][word] = o.score; } }); @@ -432,7 +432,7 @@ // create the mapping for (j = 0; j < files.length; j++) { file = files[j]; - if (file in fileMap) + if (file in fileMap && fileMap[file].indexOf(word) === -1) fileMap[file].push(word); else fileMap[file] = [word]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/genindex.html new/maxminddb-1.5.2/docs/html/genindex.html --- old/maxminddb-1.5.1/docs/html/genindex.html 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/genindex.html 2019-12-20 19:44:00.000000000 +0100 @@ -5,7 +5,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> - <title>Index — maxminddb 1.5.1 documentation</title> + <title>Index — maxminddb 1.5.2 documentation</title> <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> @@ -25,7 +25,7 @@ <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> @@ -207,12 +207,12 @@ <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2013-2019, MaxMind, Inc.. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.3.0. </div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/index.html new/maxminddb-1.5.2/docs/html/index.html --- old/maxminddb-1.5.1/docs/html/index.html 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/index.html 2019-12-20 19:44:00.000000000 +0100 @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> - <title>MaxMind DB Python Module — maxminddb 1.5.1 documentation</title> + <title>MaxMind DB Python Module — maxminddb 1.5.2 documentation</title> <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> @@ -24,7 +24,7 @@ <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="#">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="#">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> @@ -216,7 +216,7 @@ <dl class="exception"> <dt id="maxminddb.errors.InvalidDatabaseError"> <em class="property">exception </em><code class="sig-prename descclassname">maxminddb.errors.</code><code class="sig-name descname">InvalidDatabaseError</code><a class="headerlink" href="#maxminddb.errors.InvalidDatabaseError" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#RuntimeError" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">RuntimeError</span></code></a></p> +<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#RuntimeError" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">RuntimeError</span></code></a></p> <p>This error is thrown when unexpected data is found in the database.</p> </dd></dl> @@ -227,7 +227,7 @@ <dl class="class"> <dt id="maxminddb.reader.Metadata"> <em class="property">class </em><code class="sig-prename descclassname">maxminddb.reader.</code><code class="sig-name descname">Metadata</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#maxminddb.reader.Metadata" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> +<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> <p>Metadata for the MaxMind DB reader</p> <dl class="attribute"> <dt id="maxminddb.reader.Metadata.binary_format_major_version"> @@ -236,7 +236,7 @@ database.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -248,7 +248,7 @@ database.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -259,7 +259,7 @@ <dd><p>The Unix epoch for the build time of the database.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -270,7 +270,7 @@ <dd><p>A string identifying the database type, e.g., “GeoIP2-City”.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p> </dd> </dl> </dd></dl> @@ -281,7 +281,7 @@ <dd><p>A map from locales to text descriptions of the database.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>)</p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>)</p> </dd> </dl> </dd></dl> @@ -294,7 +294,7 @@ both IPv4 and IPv6 lookups.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -305,7 +305,7 @@ <dd><p>A list of locale codes supported by the databse.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>)</p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>)</p> </dd> </dl> </dd></dl> @@ -316,7 +316,7 @@ <dd><p>The number of nodes in the database.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -327,7 +327,7 @@ <dd><p>The bit size of a record in the search tree.</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -338,7 +338,7 @@ <dd><p>The size of a node in bytes</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -349,7 +349,7 @@ <dd><p>The size of the search tree</p> <dl class="field-list simple"> <dt class="field-odd">Type</dt> -<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p> +<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p> </dd> </dl> </dd></dl> @@ -359,7 +359,7 @@ <dl class="class"> <dt id="maxminddb.reader.Reader"> <em class="property">class </em><code class="sig-prename descclassname">maxminddb.reader.</code><code class="sig-name descname">Reader</code><span class="sig-paren">(</span><em class="sig-param">database</em>, <em class="sig-param">mode=0</em><span class="sig-paren">)</span><a class="headerlink" href="#maxminddb.reader.Reader" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> +<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> <p>Instances of this class provide a reader for the MaxMind DB format. IP addresses can be looked up using the <code class="docutils literal notranslate"><span class="pre">get</span></code> method.</p> <dl class="method"> @@ -428,12 +428,12 @@ <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="#">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="#">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2013-2019, MaxMind, Inc.. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.3.0. </div> </body> </html> \ No newline at end of file Binary files old/maxminddb-1.5.1/docs/html/objects.inv and new/maxminddb-1.5.2/docs/html/objects.inv differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/py-modindex.html new/maxminddb-1.5.2/docs/html/py-modindex.html --- old/maxminddb-1.5.1/docs/html/py-modindex.html 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/py-modindex.html 2019-12-20 19:44:00.000000000 +0100 @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> - <title>Python Module Index — maxminddb 1.5.1 documentation</title> + <title>Python Module Index — maxminddb 1.5.2 documentation</title> <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> @@ -27,7 +27,7 @@ <li class="right" > <a href="#" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> @@ -94,12 +94,12 @@ <li class="right" > <a href="#" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2013-2019, MaxMind, Inc.. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.3.0. </div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/docs/html/search.html new/maxminddb-1.5.2/docs/html/search.html --- old/maxminddb-1.5.1/docs/html/search.html 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/docs/html/search.html 2019-12-20 19:44:00.000000000 +0100 @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> - <title>Search — maxminddb 1.5.1 documentation</title> + <title>Search — maxminddb 1.5.2 documentation</title> <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> @@ -29,7 +29,7 @@ <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> @@ -80,12 +80,12 @@ <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.1 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="index.html">maxminddb 1.5.2 documentation</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2013-2019, MaxMind, Inc.. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.3.0. </div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/maxminddb/__init__.py new/maxminddb-1.5.2/maxminddb/__init__.py --- old/maxminddb-1.5.1/maxminddb/__init__.py 2019-09-27 23:12:33.000000000 +0200 +++ new/maxminddb-1.5.2/maxminddb/__init__.py 2019-12-20 19:43:15.000000000 +0100 @@ -48,7 +48,7 @@ __title__ = 'maxminddb' -__version__ = '1.5.1' +__version__ = '1.5.2' __author__ = 'Gregory Oschwald' __license__ = 'Apache License, Version 2.0' __copyright__ = 'Copyright 2013-2019 Maxmind, Inc.' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/maxminddb/decoder.py new/maxminddb-1.5.2/maxminddb/decoder.py --- old/maxminddb-1.5.1/maxminddb/decoder.py 2019-09-27 22:33:57.000000000 +0200 +++ new/maxminddb-1.5.2/maxminddb/decoder.py 2019-12-20 19:38:53.000000000 +0100 @@ -9,7 +9,7 @@ import struct -from maxminddb.compat import byte_from_int, int_from_bytes +from maxminddb.compat import byte_from_int, int_from_byte, int_from_bytes from maxminddb.errors import InvalidDatabaseError @@ -41,22 +41,30 @@ new_offset = offset + size return self._buffer[offset:new_offset], new_offset - # pylint: disable=no-self-argument - # |-> I am open to better ways of doing this as long as it doesn't involve - # lots of code duplication. - def _decode_packed_type(type_code, type_size, pad=False): - # pylint: disable=protected-access, missing-docstring - def unpack_type(self, size, offset): - if not pad: - self._verify_size(size, type_size) - new_offset = offset + size - packed_bytes = self._buffer[offset:new_offset] - if pad: - packed_bytes = packed_bytes.rjust(type_size, b'\x00') - (value, ) = struct.unpack(type_code, packed_bytes) - return value, new_offset + def _decode_double(self, size, offset): + self._verify_size(size, 8) + new_offset = offset + size + packed_bytes = self._buffer[offset:new_offset] + (value, ) = struct.unpack(b'!d', packed_bytes) + return value, new_offset - return unpack_type + def _decode_float(self, size, offset): + self._verify_size(size, 4) + new_offset = offset + size + packed_bytes = self._buffer[offset:new_offset] + (value, ) = struct.unpack(b'!f', packed_bytes) + return value, new_offset + + def _decode_int32(self, size, offset): + if size == 0: + return 0, offset + new_offset = offset + size + packed_bytes = self._buffer[offset:new_offset] + + if size != 4: + packed_bytes = packed_bytes.rjust(4, b'\x00') + (value, ) = struct.unpack(b'!i', packed_bytes) + return value, new_offset def _decode_map(self, size, offset): container = {} @@ -66,22 +74,25 @@ container[key] = value return container, offset - _pointer_value_offset = { - 1: 0, - 2: 2048, - 3: 526336, - 4: 0, - } - def _decode_pointer(self, size, offset): - pointer_size = ((size >> 3) & 0x3) + 1 + pointer_size = (size >> 3) + 1 + + buf = self._buffer[offset:offset + pointer_size] new_offset = offset + pointer_size - pointer_bytes = self._buffer[offset:new_offset] - packed = pointer_bytes if pointer_size == 4 else struct.pack( - b'!c', byte_from_int(size & 0x7)) + pointer_bytes - unpacked = int_from_bytes(packed) - pointer = unpacked + self._pointer_base + \ - self._pointer_value_offset[pointer_size] + + if pointer_size == 1: + buf = byte_from_int(size & 0x7) + buf + pointer = struct.unpack(b'!H', buf)[0] + self._pointer_base + elif pointer_size == 2: + buf = b'\x00' + byte_from_int(size & 0x7) + buf + pointer = struct.unpack(b'!I', buf)[0] + 2048 + self._pointer_base + elif pointer_size == 3: + buf = byte_from_int(size & 0x7) + buf + pointer = struct.unpack(b'!I', + buf)[0] + 526336 + self._pointer_base + else: + pointer = struct.unpack(b'!I', buf)[0] + self._pointer_base + if self._pointer_test: return pointer, new_offset (value, _) = self.decode(pointer) @@ -99,17 +110,17 @@ _type_decoder = { 1: _decode_pointer, 2: _decode_utf8_string, - 3: _decode_packed_type(b'!d', 8), # double, + 3: _decode_double, 4: _decode_bytes, 5: _decode_uint, # uint16 6: _decode_uint, # uint32 7: _decode_map, - 8: _decode_packed_type(b'!i', 4, pad=True), # int32 + 8: _decode_int32, 9: _decode_uint, # uint64 10: _decode_uint, # uint128 11: _decode_array, 14: _decode_boolean, - 15: _decode_packed_type(b'!f', 4), # float, + 15: _decode_float, } def decode(self, offset): @@ -119,7 +130,7 @@ offset -- the location of the data structure to decode """ new_offset = offset + 1 - (ctrl_byte, ) = struct.unpack(b'!B', self._buffer[offset:new_offset]) + ctrl_byte = int_from_byte(self._buffer[offset]) type_num = ctrl_byte >> 5 # Extended type if not type_num: @@ -136,7 +147,7 @@ return decoder(self, size, new_offset) def _read_extended(self, offset): - (next_byte, ) = struct.unpack(b'!B', self._buffer[offset:offset + 1]) + next_byte = int_from_byte(self._buffer[offset]) type_num = next_byte + 7 if type_num < 7: raise InvalidDatabaseError( @@ -153,21 +164,22 @@ def _size_from_ctrl_byte(self, ctrl_byte, offset, type_num): size = ctrl_byte & 0x1f - if type_num == 1: + if type_num == 1 or size < 29: return size, offset - bytes_to_read = 0 if size < 29 else size - 28 - new_offset = offset + bytes_to_read - size_bytes = self._buffer[offset:new_offset] - - # Using unpack rather than int_from_bytes as it is about 200 lookups - # per second faster here. if size == 29: - size = 29 + struct.unpack(b'!B', size_bytes)[0] - elif size == 30: + size = 29 + int_from_byte(self._buffer[offset]) + return size, offset + 1 + + # Using unpack rather than int_from_bytes as it is faster + # here and below. + if size == 30: + new_offset = offset + 2 + size_bytes = self._buffer[offset:new_offset] size = 285 + struct.unpack(b'!H', size_bytes)[0] - elif size > 30: - size = struct.unpack(b'!I', size_bytes.rjust(4, - b'\x00'))[0] + 65821 + return size, new_offset + new_offset = offset + 3 + size_bytes = self._buffer[offset:new_offset] + size = struct.unpack(b'!I', b'\x00' + size_bytes)[0] + 65821 return size, new_offset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/maxminddb/file.py new/maxminddb-1.5.2/maxminddb/file.py --- old/maxminddb-1.5.1/maxminddb/file.py 2019-09-27 22:31:36.000000000 +0200 +++ new/maxminddb-1.5.2/maxminddb/file.py 2019-12-20 19:38:53.000000000 +0100 @@ -21,7 +21,7 @@ if isinstance(key, slice): return self._read(key.stop - key.start, key.start) if isinstance(key, int): - return self._read(1, key) + return self._read(1, key)[0] raise TypeError("Invalid argument type.") def rfind(self, needle, start): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/maxminddb/reader.py new/maxminddb-1.5.2/maxminddb/reader.py --- old/maxminddb-1.5.1/maxminddb/reader.py 2019-09-27 22:34:27.000000000 +0200 +++ new/maxminddb-1.5.2/maxminddb/reader.py 2019-12-20 19:38:53.000000000 +0100 @@ -15,7 +15,7 @@ import struct -from maxminddb.compat import byte_from_int, compat_ip_address, string_type +from maxminddb.compat import compat_ip_address, string_type from maxminddb.const import MODE_AUTO, MODE_MMAP, MODE_FILE, MODE_MEMORY, MODE_FD from maxminddb.decoder import Decoder from maxminddb.errors import InvalidDatabaseError @@ -179,15 +179,13 @@ offset = base_offset + index * 3 node_bytes = b'\x00' + self._buffer[offset:offset + 3] elif record_size == 28: - (middle, ) = struct.unpack( - b'!B', self._buffer[base_offset + 3:base_offset + 4]) + offset = base_offset + 3 * index + node_bytes = bytearray(self._buffer[offset:offset + 4]) if index: - middle &= 0x0F + node_bytes[0] = 0x0F & node_bytes[0] else: - middle = (0xF0 & middle) >> 4 - offset = base_offset + index * 4 - node_bytes = byte_from_int(middle) + self._buffer[offset:offset + - 3] + middle = (0xF0 & node_bytes.pop()) >> 4 + node_bytes.insert(0, middle) elif record_size == 32: offset = base_offset + index * 4 node_bytes = self._buffer[offset:offset + 4] @@ -200,7 +198,7 @@ resolved = pointer - self._metadata.node_count + \ self._metadata.search_tree_size - if resolved > self._buffer_size: + if resolved >= self._buffer_size: raise InvalidDatabaseError( "The MaxMind DB file's search tree is corrupt") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maxminddb-1.5.1/maxminddb.egg-info/PKG-INFO new/maxminddb-1.5.2/maxminddb.egg-info/PKG-INFO --- old/maxminddb-1.5.1/maxminddb.egg-info/PKG-INFO 2019-09-27 23:12:47.000000000 +0200 +++ new/maxminddb-1.5.2/maxminddb.egg-info/PKG-INFO 2019-12-20 19:44:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: maxminddb -Version: 1.5.1 +Version: 1.5.2 Summary: Reader for the MaxMind DB format Home-page: http://www.maxmind.com/ Author: Gregory Oschwald