Skip to content

Commit a24eb74

Browse files
jongyoulclaude
andcommitted
[ZEPPELIN-6404] Fix empty response body handling in merge_pr.py
JIRA transition API returns empty response body on success, which caused a JSONDecodeError. Return empty dict when body is empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 221c0c5 commit a24eb74

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

dev/merge_pr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ def _http(self, method, url, payload=None, auth=""):
9292
req.add_header("Authorization", auth)
9393
try:
9494
with urllib.request.urlopen(req) as resp:
95-
return resp.status, json.loads(resp.read().decode())
95+
body = resp.read().decode()
96+
return resp.status, json.loads(body) if body else {}
9697
except urllib.error.HTTPError as e:
9798
err_body = e.read().decode() if e.fp else ""
9899
try:
99-
return e.code, json.loads(err_body)
100+
return e.code, json.loads(err_body) if err_body else {}
100101
except json.JSONDecodeError:
101102
return e.code, {"error": err_body}
102103

0 commit comments

Comments
 (0)