Skip to content

Commit 108adc4

Browse files
committed
[ISSUE-1242] prevented weird exceptions related to integer handling
if keys or values in the response json are `int`s, the `k + ": " + v` will fail because of an `int` is not a `str`. In order to avoid this, we can either use `%`-formatting, `.format` formatting, or f-strings. We chose `.format` for compatability, but regardless of which direction, the issue should be addressed one of those ways.
1 parent 176da86 commit 108adc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

atlassian/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def raise_for_status(self, response):
477477
try:
478478
j = response.json()
479479
if self.url == "https://api.atlassian.com":
480-
error_msg = "\n".join([k + ": " + v for k, v in j.items()])
480+
error_msg = "\n".join([f"{}: {}".format(k, v) for k, v in j.items()])
481481
else:
482482
error_msg_list = j.get("errorMessages", list())
483483
errors = j.get("errors", dict())

0 commit comments

Comments
 (0)