according to https://docs.python.org/3/library/json.html#json.loads needs explicit encoding on older Python 3:
Changed in version 3.6: s can now be of type bytes or bytearray. The input encoding should be UTF-8, UTF-16 or UTF-32.
We applied this to get it working internally:
--- vercheck.py.old 2021-08-30 13:55:05.124482403 +0200
+++ vercheck.py 2021-08-30 13:15:28.445376243 +0200
@@ -478,11 +478,11 @@
if r.status == 200:
if tries > 0:
print('thread %d got a good reply after %d tries' % (self.instance_nr, tries))
- return_data = json.loads(r.data)
+ return_data = json.loads(r.data.decode('utf-8'))
valid_response = True
elif r.status in self.error_states:
if r.data:
- json_data = json.loads(r.data)
+ json_data = json.loads(r.data.decode('utf-8'))
print('cannot be processed due to error: [' + json_data['error'] + ']')
print('thread %d got a fatal error (%d). Results will be incomplete!\nPlease contact the service administrators or try again later.' % (self.instance_nr, r.status))
break
Hi,
according to https://docs.python.org/3/library/json.html#json.loads needs explicit encoding on older Python 3: Changed in version 3.6: s can now be of type bytes or bytearray. The input encoding should be UTF-8, UTF-16 or UTF-32.
We applied this to get it working internally: