summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-11-10 15:50:40 +0000
committerColin Watson <cjwatson@debian.org>2017-11-10 15:50:40 +0000
commit949b7072cabce0daed6c94993ad44c8ea8648dbd (patch)
treef5fd40a612e5e3d861aa4ccc6cc8d2a84485b824
parent37d61d0415f6cc96a7a9abe057e1ae0f89fd977e (diff)
Import py-macaroon-bakery_0.0.6.orig.tar.gz
-rwxr-xr-xdocs/conf.py2
-rw-r--r--macaroonbakery/httpbakery/agent/agent.py9
-rwxr-xr-xsetup.py2
3 files changed, 8 insertions, 5 deletions
diff --git a/docs/conf.py b/docs/conf.py
index df296f1..a64ec3a 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -63,7 +63,7 @@ copyright = u'2017, Juju UI Team'
# the built documents.
#
# The short X.Y version and the full version.
-version = release = '0.0.4'
+version = release = '0.0.6'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/macaroonbakery/httpbakery/agent/agent.py b/macaroonbakery/httpbakery/agent/agent.py
index 862f00e..ad56015 100644
--- a/macaroonbakery/httpbakery/agent/agent.py
+++ b/macaroonbakery/httpbakery/agent/agent.py
@@ -6,6 +6,7 @@ import json
import nacl.public
import nacl.encoding
+import nacl.exceptions
import requests.cookies
import six
from six.moves.urllib.parse import urlparse
@@ -35,8 +36,10 @@ def load_agent_file(filename, cookies=None):
with open(filename) as f:
data = json.load(f)
try:
- key = nacl.public.PrivateKey(data['key']['private'],
- nacl.encoding.Base64Encoder)
+ key = nacl.public.PrivateKey(
+ data['key']['private'],
+ nacl.encoding.Base64Encoder,
+ )
if cookies is None:
cookies = requests.cookies.RequestsCookieJar()
for agent in data['agents']:
@@ -54,7 +57,7 @@ def load_agent_file(filename, cookies=None):
path=u.path)
cookies.set_cookie(cookie)
return cookies, key
- except (KeyError, ValueError) as e:
+ except (KeyError, ValueError, nacl.exceptions.TypeError) as e:
raise AgentFileFormatError('invalid agent file', e)
diff --git a/setup.py b/setup.py
index 340bf3a..40155f9 100755
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ from setuptools import (
PROJECT_NAME = 'macaroonbakery'
-VERSION = (0, 0, 5)
+VERSION = (0, 0, 6)
def get_version():