Commit 9722942
committed
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:
```python
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
Signed-off-by: Jaroslav Henner <[email protected]>1 parent 9f56d1c commit 9722942
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
475 | 479 | | |
476 | 480 | | |
477 | 481 | | |
| |||
0 commit comments