[Python-modules-commits] [python-launchpadlib] 04/07: Make sure query_string is str, before decoding.

Dimitri John Ledkov xnox at moszumanska.debian.org
Sat Aug 13 03:22:01 UTC 2016


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

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

commit e814892c8884fdfc5548e659d5b7ee9ac7d7ea93
Author: Dimitri John Ledkov <xnox at ubuntu.com>
Date:   Sat Aug 13 04:12:42 2016 +0100

    Make sure query_string is str, before decoding.
    
    Origin: commit, revision id: xnox at ubuntu.com-20160813025000-y92qzzkalwf92n9c
    Author: Dimitri John Ledkov <xnox at ubuntu.com>
    Bug: https://launchpad.net/bugs/1471927
    Last-Update: 2016-08-13
    X-Bzr-Revision-Id: xnox at ubuntu.com-20160813025000-y92qzzkalwf92n9c
---
 src/launchpadlib/credentials.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/launchpadlib/credentials.py b/src/launchpadlib/credentials.py
index c0ab813..bb4f74a 100644
--- a/src/launchpadlib/credentials.py
+++ b/src/launchpadlib/credentials.py
@@ -248,6 +248,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, str):
+            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, (

-- 
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