Author: sebb Date: Fri Aug 8 13:54:30 2025 New Revision: 1927698 Log: Drop python2 support
Modified: comdev/reporter.apache.org/trunk/scripts/readjira.py Modified: comdev/reporter.apache.org/trunk/scripts/readjira.py ============================================================================== --- comdev/reporter.apache.org/trunk/scripts/readjira.py Fri Aug 8 12:35:14 2025 (r1927697) +++ comdev/reporter.apache.org/trunk/scripts/readjira.py Fri Aug 8 13:54:30 2025 (r1927698) @@ -16,14 +16,8 @@ import errtee # this is used, even though it is not referenced import os, json, base64, time, sys -try: - from urllib.request import urlopen, Request - from urllib.error import HTTPError - py3 = True -except: - from urllib2 import urlopen,Request - from urllib2 import HTTPError - py3 = False +from urllib.request import urlopen, Request +from urllib.error import HTTPError from os import listdir from os.path import isfile, join, dirname, abspath from inspect import getsourcefile @@ -41,10 +35,7 @@ with open("/usr/local/etc/tokens/jira.tx f.close() __AUTHSTRING = '%s:%s' % ('githubbot', jirapass) -if py3: - base64string = base64.b64encode(__AUTHSTRING.encode(encoding='utf-8')).decode(encoding='utf-8') -else: - base64string = base64.encodestring(__AUTHSTRING)[:-1] # python2 adds a trailing eol +base64string = base64.b64encode(__AUTHSTRING.encode(encoding='utf-8')).decode(encoding='utf-8') JIRATIMEOUT=90 # This may need to be adjusted jiraerrors = 0 # count how many errors occurred