Skip to content

Commit

Permalink
Remove syntax incompatible with python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
HoussemNasri committed Apr 17, 2024
1 parent 8f7e4e3 commit 4a6a9c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion atlassian/bitbucket/cloud/repositories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def __init__(self, data, *args, **kwargs):
self.__hooks = Hooks(
"{}/hooks".format(self.url),
data={"links": {"hooks": {"href": "{}/hooks".format(self.url)}}},
**self._new_session_args,
**self._new_session_args
)
self.__default_reviewers = DefaultReviewers("{}/default-reviewers".format(self.url), **self._new_session_args)
self.__deployment_environments = DeploymentEnvironments(
Expand Down
2 changes: 1 addition & 1 deletion atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def download_attachments_from_page(self, page_id, path=None):
if not file_name:
file_name = attachment["id"] # if the attachment has no title, use attachment_id as a filename
download_link = self.url + attachment["_links"]["download"]
r = self._session.get(f"{download_link}")
r = self._session.get(str(download_link))
file_path = os.path.join(path, file_name)
with open(file_path, "wb") as f:
f.write(r.content)
Expand Down
6 changes: 3 additions & 3 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ def download_attachments_from_issue(self, issue, path=None, cloud=True):
path = os.getcwd()
issue_id = self.issue(issue, fields="id")["id"]
if cloud:
url = self.url + f"/secure/issueAttachments/{issue_id}.zip"
url = self.url + "/secure/issueAttachments/{}.zip".format(issue_id)
else:
url = self.url + f"/secure/attachmentzip/{issue_id}.zip"
url = self.url + "/secure/attachmentzip/{}.zip".format(issue_id)
response = self._session.get(url)
attachment_name = f"{issue_id}_attachments.zip"
attachment_name = "{}_attachments.zip".format(issue_id)
file_path = os.path.join(path, attachment_name)
# if Jira issue doesn't have any attachments _session.get request response will return 22 bytes of PKzip format
file_size = sum(len(chunk) for chunk in response.iter_content(8196))
Expand Down

0 comments on commit 4a6a9c3

Please sign in to comment.