atlas
atlas copied to clipboard
ATLAS-4676: do not expect response body to be a valid JSON
trafficstars
@dolfinus - thank you reporting this issue and the patch. Use of f-string formatting will require Python 3.6 or later. I suggest to retain use of .format() method to change Python version requirement. How about the following alternate fix?
body = ""
if response.content:
try:
body = response.json()
except Exception:
body = response.content
msg = "Metadata service API {method} {path} failed with status {status}. Response body is: {body}".format(**{'method': api.method, 'path': api.path, 'status': response.status_code, 'body': body})
Python 3.6 already reached end of life (23.12.2021), 2.7 is not supported since 01.01.2020. A lot of packages already dropped support of such old Python versions, why bother keeping it?
Merged: https://github.com/apache/atlas/commit/a43ed6c11d3ca3c8a63b86981c3241365eb60b79