From 8a55ee75c2bb4157ef2b25b417cd074c10eeb24a Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Oct 2023 00:38:02 -0500 Subject: [PATCH 1/2] Changing file to read binary --- validator/scripts/diff.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/validator/scripts/diff.py b/validator/scripts/diff.py index 0f9c03044..f9efe8fb6 100644 --- a/validator/scripts/diff.py +++ b/validator/scripts/diff.py @@ -82,10 +82,9 @@ def createTicket(issueType: str, jira_connection: JIRA, URI: str, coursesImpacte customfield_10016=1, labels=["Engineering"], ) - f = open("description.txt", "r") if os.path.getsize("description.txt"): - jira_connection.add_attachment(issue=ticket, attachment=f) - f.close() + with open("description.txt", "rb") as f: + jira_connection.add_attachment(issue=ticket, attachment=f) os.remove("description.txt") #Establishes JIRA connection and ierates through each major for versioning issues From 42aedc935e863e4992a23f723c10e5a2af7ad28c Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Oct 2023 00:44:01 -0500 Subject: [PATCH 2/2] Changing variable name for typing issues --- validator/scripts/diff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/validator/scripts/diff.py b/validator/scripts/diff.py index f9efe8fb6..290be719e 100644 --- a/validator/scripts/diff.py +++ b/validator/scripts/diff.py @@ -83,8 +83,8 @@ def createTicket(issueType: str, jira_connection: JIRA, URI: str, coursesImpacte labels=["Engineering"], ) if os.path.getsize("description.txt"): - with open("description.txt", "rb") as f: - jira_connection.add_attachment(issue=ticket, attachment=f) + with open("description.txt", "rb") as descriptionFile: + jira_connection.add_attachment(issue=ticket, attachment=descriptionFile) os.remove("description.txt") #Establishes JIRA connection and ierates through each major for versioning issues