[Python-modules-commits] [python-geoip2] 01/04: Import python-geoip2_2.4.2+dfsg1.orig.tar.gz

Ondřej Nový onovy at moszumanska.debian.org
Sun Dec 11 14:52:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

onovy pushed a commit to branch master
in repository python-geoip2.

commit 7318465bc7198883f7ad048f0a08d56e439f316e
Author: Ondřej Nový <onovy at debian.org>
Date:   Sun Dec 11 15:46:39 2016 +0100

    Import python-geoip2_2.4.2+dfsg1.orig.tar.gz
---
 HISTORY.rst              |  9 +++++++++
 PKG-INFO                 |  2 +-
 geoip2.egg-info/PKG-INFO |  2 +-
 geoip2/__init__.py       |  2 +-
 geoip2/webservice.py     | 10 +++++++---
 setup.py                 |  2 +-
 6 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/HISTORY.rst b/HISTORY.rst
index 4423f68..120054b 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,15 @@
 History
 -------
 
+2.4.2 (2016-12-08)
+++++++++++++++++++
+
+* Recent releases of ``requests`` (2.12.2 and 2.12.3) require that the
+  username for basic authentication be a string or bytes. The documentation
+  for this module uses an integer for the ``user_id``, which will break with
+  these ``requests`` versions. The ``user_id`` is now converted to bytes
+  before being passed to ``requests``.
+
 2.4.1 (2016-11-21)
 ++++++++++++++++++
 
diff --git a/PKG-INFO b/PKG-INFO
index 420608e..87cf1ef 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: geoip2
-Version: 2.4.1
+Version: 2.4.2
 Summary: MaxMind GeoIP2 API
 Home-page: http://www.maxmind.com/
 Author: Gregory Oschwald
diff --git a/geoip2.egg-info/PKG-INFO b/geoip2.egg-info/PKG-INFO
index 420608e..87cf1ef 100644
--- a/geoip2.egg-info/PKG-INFO
+++ b/geoip2.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: geoip2
-Version: 2.4.1
+Version: 2.4.2
 Summary: MaxMind GeoIP2 API
 Home-page: http://www.maxmind.com/
 Author: Gregory Oschwald
diff --git a/geoip2/__init__.py b/geoip2/__init__.py
index f9cc758..d5ac954 100644
--- a/geoip2/__init__.py
+++ b/geoip2/__init__.py
@@ -1,7 +1,7 @@
 # pylint:disable=C0111
 
 __title__ = 'geoip2'
-__version__ = '2.4.1'
+__version__ = '2.4.2'
 __author__ = 'Gregory Oschwald'
 __license__ = 'Apache License, Version 2.0'
 __copyright__ = 'Copyright (c) 2013-2016 Maxmind, Inc.'
diff --git a/geoip2/webservice.py b/geoip2/webservice.py
index c64f1b8..18e593d 100644
--- a/geoip2/webservice.py
+++ b/geoip2/webservice.py
@@ -93,7 +93,9 @@ class Client(object):
         if locales is None:
             locales = ['en']
         self._locales = locales
-        self._user_id = user_id
+        # requests 2.12.2 requires that the username passed to auth be bytes
+        # or a string, with the former being preferred.
+        self._user_id = str(user_id)
         self._license_key = license_key
         self._base_uri = 'https://%s/geoip/v2.1' % host
         self._timeout = timeout
@@ -141,8 +143,10 @@ class Client(object):
         uri = '/'.join([self._base_uri, path, ip_address])
         response = requests.get(uri,
                                 auth=(self._user_id, self._license_key),
-                                headers={'Accept': 'application/json',
-                                         'User-Agent': self._user_agent()},
+                                headers={
+                                    'Accept': 'application/json',
+                                    'User-Agent': self._user_agent()
+                                },
                                 timeout=self._timeout)
         if response.status_code == 200:
             body = self._handle_success(response, uri)
diff --git a/setup.py b/setup.py
index d8b6d36..0b67cba 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ setup(
     extras_require={
         ':python_version=="2.6" or python_version=="2.7"': ['ipaddress']
     },
-    tests_require=['requests_mock'],
+    tests_require=['requests_mock>=0.5'],
     test_suite="tests",
     license=geoip2.__license__,
     classifiers=[

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-geoip2.git



More information about the Python-modules-commits mailing list