podman-py
podman-py copied to clipboard
Don't try to parse the response json when not_modified
In case of not_modified (HTTP 304), there is no json in the response body. Json parsing fails like:
if response.status_code == requests.codes.not_modified:
if kwargs.get("ignore", False):
return
body = response
> raise APIError(body["cause"], response=response, explanation=body)
E TypeError: 'APIResponse' object is not subscriptable
.venv/lib/python3.12/site-packages/podman/domain/containers.py:477: TypeError
This patch fixes this in the way that APIError is rised with content from the text of the requests response
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: jarovo Once this PR has been reviewed and has the lgtm label, please assign giuseppe for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/packit rebuild-failed