atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.29k stars 643 forks source link

[ISSUE-1242] prevented weird exceptions related to integer handling #1244

Closed 2ps closed 9 months ago

2ps commented 9 months ago

if keys or values in the response json are ints, the k + ": " + v expression will fail because 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.

addresses #1242

gonchik commented 9 months ago

@2ps could wrap via str() instead of f-strings. Because it will break 2.7 compatibility

gonchik commented 9 months ago

@2ps please use format in that situation please?

2ps commented 9 months ago

Apologies

@2ps please use format in that situation please?

Apologies for the late response, will do. That said, the setup.py file indicates that python2 isn't supported -- we may also want to update that to indicate support for python 2 and the eol'd python 2.7.

codecov-commenter commented 9 months ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02% :warning:

Comparison is base (176da86) 34.47% compared to head (b42b065) 34.45%. Report is 2 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1244 +/- ## ========================================== - Coverage 34.47% 34.45% -0.02% ========================================== Files 44 44 Lines 8105 8108 +3 Branches 1118 1119 +1 ========================================== Hits 2794 2794 - Misses 5197 5200 +3 Partials 114 114 ``` | [Files Changed](https://app.codecov.io/gh/atlassian-api/atlassian-python-api/pull/1244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [atlassian/rest\_client.py](https://app.codecov.io/gh/atlassian-api/atlassian-python-api/pull/1244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YXRsYXNzaWFuL3Jlc3RfY2xpZW50LnB5) | `67.97% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/atlassian-api/atlassian-python-api/pull/1244/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gonchik commented 9 months ago

Thanks