diff --git a/atlassian/bitbucket/__init__.py b/atlassian/bitbucket/__init__.py index 9137b1e21..6d0eceaf9 100644 --- a/atlassian/bitbucket/__init__.py +++ b/atlassian/bitbucket/__init__.py @@ -2208,13 +2208,13 @@ def is_pull_request_can_be_merged(self, project_key, repository_slug, pr_id): def merge_pull_request( self, - project_key: str, - repository_slug: str, - pr_id: int, - merge_message: str, - close_source_branch: bool = False, - merge_strategy: Union[str, MergeStrategy] = MergeStrategy.MERGE_COMMIT, - pr_version: Optional[int] = None, + project_key, + repository_slug, + pr_id, + merge_message, + close_source_branch=False, + merge_strategy=MergeStrategy.MERGE_COMMIT, + pr_version=None, ): """ Merge pull request diff --git a/atlassian/bitbucket/cloud/repositories/__init__.py b/atlassian/bitbucket/cloud/repositories/__init__.py index c0ab116c7..cb1a5c053 100644 --- a/atlassian/bitbucket/cloud/repositories/__init__.py +++ b/atlassian/bitbucket/cloud/repositories/__init__.py @@ -263,8 +263,8 @@ 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 + ) # fmt: skip self.__default_reviewers = DefaultReviewers("{}/default-reviewers".format(self.url), **self._new_session_args) self.__deployment_environments = DeploymentEnvironments( "{}/environments".format(self.url), **self._new_session_args diff --git a/atlassian/confluence.py b/atlassian/confluence.py index 6fa570b8a..0bea94f6b 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -1411,7 +1411,7 @@ def download_attachments_from_page(self, page_id, path=None, start=0, limit=50): 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(download_link) file_path = os.path.join(path, file_name) with open(file_path, "wb") as f: f.write(r.content) @@ -3091,7 +3091,7 @@ def create_whiteboard(self, spaceId, title=None, parentId=None): def get_whiteboard(self, whiteboard_id): try: - url = f"/api/v2/whiteboards/{whiteboard_id}" + url = "/api/v2/whiteboards/%s" % (whiteboard_id) return self.get(url) except HTTPError as e: # Default 404 error handling is ambiguous @@ -3104,7 +3104,7 @@ def get_whiteboard(self, whiteboard_id): def delete_whiteboard(self, whiteboard_id): try: - url = f"/api/v2/whiteboards/{whiteboard_id}" + url = "/api/v2/whiteboards/%s" % (whiteboard_id) return self.delete(url) except HTTPError as e: # # Default 404 error handling is ambiguous @@ -3240,7 +3240,7 @@ def add_user_to_group(self, username, group_name): :param group_name: str - name of group to add user to :return: Current state of the group """ - url = f"rest/api/user/{username}/group/{group_name}" + url = "rest/api/user/%s/group/%s" % (username, group_name) return self.put(url) def add_space_permissions( diff --git a/atlassian/jira.py b/atlassian/jira.py index e5fada238..97f55d1e2 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -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/%s.zip" % (issue_id) else: - url = self.url + f"/secure/attachmentzip/{issue_id}.zip" + url = self.url + "/secure/attachmentzip/%s.zip" % (issue_id) response = self._session.get(url) - attachment_name = f"{issue_id}_attachments.zip" + attachment_name = "%s_attachments.zip" % (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))