diff --git a/tests/test_nilmdb.py b/tests/test_nilmdb.py index aa35dac..b756151 100644 --- a/tests/test_nilmdb.py +++ b/tests/test_nilmdb.py @@ -136,8 +136,9 @@ class TestBlockingServer(object): thread.join() def geturl(path): - req = urlopen("http://127.0.0.1:32180" + path, timeout = 10) - return req.read() + resp = urlopen("http://127.0.0.1:32180" + path, timeout = 10) + body = resp.read() + return body.decode(resp.headers.get_content_charset() or 'utf-8') def getjson(path): return json.loads(geturl(path))