Dolda2000 GitWeb
/
utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d2252d1
)
acmecert: Handle older versions of the JSON library.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 23 Jan 2022 19:12:18 +0000
(20:12 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 23 Jan 2022 19:12:18 +0000
(20:12 +0100)
acmecert
patch
|
blob
|
blame
|
history
diff --git
a/acmecert
b/acmecert
index
56b1a58
..
c8c05ff
100755
(executable)
--- a/
acmecert
+++ b/
acmecert
@@
-354,7
+354,7
@@
class problem(msgerror):
@classmethod
def read(cls, err, **kw):
@classmethod
def read(cls, err, **kw):
- self = cls(err.code, json.load
(err
), **kw)
+ self = cls(err.code, json.load
s(err.read().decode("utf-8")
), **kw)
return self
def jreq(url, data, auth):
return self
def jreq(url, data, auth):
@@
-369,7
+369,7
@@
def jreq(url, data, auth):
enc = {"protected": authdata, "payload": data, "signature": seal}
try:
with req(url, data=enc) as resp:
enc = {"protected": authdata, "payload": data, "signature": seal}
try:
with req(url, data=enc) as resp:
- return json.load
(resp
), resp.headers
+ return json.load
s(resp.read().decode("utf-8")
), resp.headers
except urllib.error.HTTPError as exc:
if exc.headers["Content-Type"] == "application/problem+json":
raise problem.read(exc, url=url)
except urllib.error.HTTPError as exc:
if exc.headers["Content-Type"] == "application/problem+json":
raise problem.read(exc, url=url)
@@
-432,7
+432,7
@@
def directory():
global _directory
if _directory is None:
with req(service) as resp:
global _directory
if _directory is None:
with req(service) as resp:
- _directory = json.load
(resp
)
+ _directory = json.load
s(resp.read().decode("utf-8")
)
return _directory
def register(keysize=4096):
return _directory
def register(keysize=4096):