Skip to content

Commit

Permalink
[ISSUE-1242] prevented weird exceptions related to integer handling (#…
Browse files Browse the repository at this point in the history
…1244)

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.
  • Loading branch information
2ps authored Sep 16, 2023
1 parent 15471bf commit 480bc47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion atlassian/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def raise_for_status(self, response):
try:
j = response.json()
if self.url == "https://api.atlassian.com":
error_msg = "\n".join([k + ": " + v for k, v in j.items()])
error_msg = "\n".join(["{}: {}".format(k, v) for k, v in j.items()])
else:
error_msg_list = j.get("errorMessages", list())
errors = j.get("errors", dict())
Expand Down

0 comments on commit 480bc47

Please sign in to comment.