atlas icon indicating copy to clipboard operation
atlas copied to clipboard

ATLAS-4676: do not expect response body to be a valid JSON

Open dolfinus opened this issue 3 years ago • 2 comments
trafficstars

dolfinus avatar Sep 16 '22 14:09 dolfinus

@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})

mneethiraj avatar Oct 11 '22 03:10 mneethiraj

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?

dolfinus avatar Oct 11 '22 07:10 dolfinus

Merged: https://github.com/apache/atlas/commit/a43ed6c11d3ca3c8a63b86981c3241365eb60b79

dolfinus avatar Nov 07 '22 09:11 dolfinus