[Python-modules-commits] [python-launchpadlib] 01/04: Import python-launchpadlib_1.10.5.orig.tar.gz

Colin Watson cjwatson at moszumanska.debian.org
Tue Sep 5 11:39:37 UTC 2017


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

cjwatson pushed a commit to branch master
in repository python-launchpadlib.

commit 058685f882beb7f51e2471bba15f11593f40a5db
Author: Colin Watson <cjwatson at debian.org>
Date:   Tue Sep 5 12:28:55 2017 +0100

    Import python-launchpadlib_1.10.5.orig.tar.gz
---
 PKG-INFO                               |  8 +++++++-
 src/launchpadlib.egg-info/PKG-INFO     |  8 +++++++-
 src/launchpadlib/NEWS.txt              |  6 ++++++
 src/launchpadlib/__init__.py           |  2 +-
 src/launchpadlib/credentials.py        |  8 ++++----
 src/launchpadlib/docs/introduction.txt | 16 ++++++++++++++++
 6 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index 40f5d79..1c3a91b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: launchpadlib
-Version: 1.10.4
+Version: 1.10.5
 Summary: Script Launchpad through its web services interfaces.  Officially supported.
 Home-page: https://help.launchpad.net/API/launchpadlib
 Author: LAZR Developers
@@ -31,6 +31,12 @@ Description: ..
         NEWS for launchpadlib
         =====================
         
+        1.10.5 (2017-02-02)
+        ===================
+        - Fix AccessToken.from_string crash on Python 3.  [bug=1471927]
+        - Fix fallback if authorizing a token with a browser raises webbrowser.Error.
+        - Stop introduction.txt doctest from writing to $HOME.
+        
         1.10.4 (2016-07-12)
         ===================
         - Fix _bad_oauth_token crash on Python 3.  [bug=1471894]
diff --git a/src/launchpadlib.egg-info/PKG-INFO b/src/launchpadlib.egg-info/PKG-INFO
index 40f5d79..1c3a91b 100644
--- a/src/launchpadlib.egg-info/PKG-INFO
+++ b/src/launchpadlib.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: launchpadlib
-Version: 1.10.4
+Version: 1.10.5
 Summary: Script Launchpad through its web services interfaces.  Officially supported.
 Home-page: https://help.launchpad.net/API/launchpadlib
 Author: LAZR Developers
@@ -31,6 +31,12 @@ Description: ..
         NEWS for launchpadlib
         =====================
         
+        1.10.5 (2017-02-02)
+        ===================
+        - Fix AccessToken.from_string crash on Python 3.  [bug=1471927]
+        - Fix fallback if authorizing a token with a browser raises webbrowser.Error.
+        - Stop introduction.txt doctest from writing to $HOME.
+        
         1.10.4 (2016-07-12)
         ===================
         - Fix _bad_oauth_token crash on Python 3.  [bug=1471894]
diff --git a/src/launchpadlib/NEWS.txt b/src/launchpadlib/NEWS.txt
index 0122d9b..2fb251c 100644
--- a/src/launchpadlib/NEWS.txt
+++ b/src/launchpadlib/NEWS.txt
@@ -2,6 +2,12 @@
 NEWS for launchpadlib
 =====================
 
+1.10.5 (2017-02-02)
+===================
+- Fix AccessToken.from_string crash on Python 3.  [bug=1471927]
+- Fix fallback if authorizing a token with a browser raises webbrowser.Error.
+- Stop introduction.txt doctest from writing to $HOME.
+
 1.10.4 (2016-07-12)
 ===================
 - Fix _bad_oauth_token crash on Python 3.  [bug=1471894]
diff --git a/src/launchpadlib/__init__.py b/src/launchpadlib/__init__.py
index 0c82b6c..97fbb3b 100644
--- a/src/launchpadlib/__init__.py
+++ b/src/launchpadlib/__init__.py
@@ -14,4 +14,4 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with launchpadlib. If not, see <http://www.gnu.org/licenses/>.
 
-__version__ = '1.10.4'
+__version__ = '1.10.5'
diff --git a/src/launchpadlib/credentials.py b/src/launchpadlib/credentials.py
index c0ab813..634e4d8 100644
--- a/src/launchpadlib/credentials.py
+++ b/src/launchpadlib/credentials.py
@@ -63,10 +63,8 @@ except ImportError:
 if bytes is str:
     # Python 2
     unicode_type = unicode
-    binary_type = str
 else:
     unicode_type = str
-    binary_type = bytes
     
 from lazr.restfulclient.errors import HTTPError
 from lazr.restfulclient.authorize.oauth import (
@@ -191,7 +189,7 @@ class Credentials(OAuthAuthorizer):
         if token_format == self.DICT_TOKEN_FORMAT:
             headers['Accept'] = 'application/json'
         response, content = _http_post(url, headers, params)
-        if isinstance(content, binary_type):
+        if isinstance(content, bytes):
             content = content.decode('utf-8')
         if token_format == self.DICT_TOKEN_FORMAT:
             params = json.loads(content)
@@ -248,6 +246,8 @@ class AccessToken(_AccessToken):
     @classmethod
     def from_string(cls, query_string):
         """Create and return a new `AccessToken` from the given string."""
+        if not isinstance(query_string, unicode_type):
+            query_string = query_string.decode('utf-8')
         params = cgi.parse_qs(query_string, keep_blank_values=False)
         key = params['oauth_token']
         assert len(key) == 1, (
@@ -639,7 +639,7 @@ class AuthorizeRequestTokenWithBrowser(RequestTokenAuthorizationEngine):
             browser = getattr(browser_obj, "basename", None)
             console_browser = browser in self.TERMINAL_BROWSERS
         except webbrowser.Error:
-            browser = None
+            browser_obj = None
             console_browser = False
 
         if console_browser:
diff --git a/src/launchpadlib/docs/introduction.txt b/src/launchpadlib/docs/introduction.txt
index 72f64b9..88ede40 100644
--- a/src/launchpadlib/docs/introduction.txt
+++ b/src/launchpadlib/docs/introduction.txt
@@ -6,6 +6,20 @@ launchpadlib is the standalone Python language bindings to Launchpad's web
 services API.  It is officially supported by Canonical, although third party
 packages may be available to provide bindings to other programming languages.
 
+Set up
+======
+
+launchpadlib writes to $HOME, so isolate ourselves.
+
+    >>> from fixtures import (
+    ...     EnvironmentVariable,
+    ...     TempDir,
+    ...     )
+    >>> tempdir_fixture = TempDir()
+    >>> tempdir_fixture.setUp()
+    >>> home_fixture = EnvironmentVariable('HOME', tempdir_fixture.path)
+    >>> home_fixture.setUp()
+
 OAuth authentication
 ====================
 
@@ -396,3 +410,5 @@ Clean up
 ========
 
     >>> os.remove(path)
+    >>> home_fixture.cleanUp()
+    >>> tempdir_fixture.cleanUp()

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



More information about the Python-modules-commits mailing list