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
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.  I
chose f-strings for usability, but regardless of which direction, the
issue should be addressed one of those ways.
  • Loading branch information
2ps committed Sep 9, 2023
1 parent 176da86 commit b01ecd0
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 @@ -477,7 +477,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([f"{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 b01ecd0

Please sign in to comment.