mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-08 11:24:25 +00:00
Make sure the JSON is given back as bytes
This commit is contained in:
parent
444c3e6ce4
commit
62f5fb9d28
@ -1,3 +1,4 @@
|
||||
from future.utils import PY2
|
||||
|
||||
import time, json
|
||||
from twisted.python.filepath import FilePath
|
||||
@ -317,4 +318,7 @@ class StorageStatus(MultiFormatResource):
|
||||
"lease-checker": self._storage.lease_checker.get_state(),
|
||||
"lease-checker-progress": self._storage.lease_checker.get_progress(),
|
||||
}
|
||||
return json.dumps(d, indent=1) + "\n"
|
||||
result = json.dumps(d, indent=1) + "\n"
|
||||
if PY2:
|
||||
result = result.decode("utf-8")
|
||||
return result.encode("utf-8")
|
||||
|
Loading…
x
Reference in New Issue
Block a user