diff --git a/CHANGELOG.md b/CHANGELOG.md index 75317f22362c35df9ebc2399599226f506b1e945..e45657c1e056c0ac39f6be04ac37cb0bddb62c15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#75](https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/75), [#103](https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/103) Fixed JSON schema to allow more sections, and correct requirements for password method. +- `read()` of MockupResponse returns now an appropriate type on modern systems ### Security ### diff --git a/src/caosdb/connection/mockup.py b/src/caosdb/connection/mockup.py index 692ec2b13f16556a9acfab2a377a04aaf27d650c..aaa9e09b4a4d9ca26fab5c2403e57b75595b86a8 100644 --- a/src/caosdb/connection/mockup.py +++ b/src/caosdb/connection/mockup.py @@ -26,6 +26,7 @@ up a tcp connection.""" from __future__ import unicode_literals, print_function from io import StringIO +from sys import hexversion from .connection import CaosDBServerConnection, CaosDBHTTPResponse @@ -56,7 +57,10 @@ class MockUpResponse(CaosDBHTTPResponse): def read(self, size=-1): """Return the body of the response.""" - return self.response.read(size) + if hexversion < 0x03000000: + return self.response.read(size) + else: + return self.response.read(size).encode() def getheader(self, name, default=None): """Get the contents of the header `name`, or `default` if there is no