1
0
mirror of https://github.com/moepman/acertmgr.git synced 2024-12-28 20:41:52 +01:00

tools: Fix IDNA handler (again)

This commit is contained in:
Kishi85 2020-03-04 14:05:04 +01:00
parent b37d0cad94
commit 0648cb7b38

View File

@ -375,7 +375,8 @@ def target_is_current(target, file):
# @brief convert domain list to idna representation (if applicable
def idna_convert(domainlist):
if 'idna' in sys.modules and any(ord(c) >= 128 for c in ''.join(domainlist)):
if any(ord(c) >= 128 for c in ''.join(domainlist)):
try:
domaintranslation = list()
for domain in domainlist:
if any(ord(c) >= 128 for c in domain):
@ -389,9 +390,8 @@ def idna_convert(domainlist):
result = domain, domain
domaintranslation.append(result)
return domaintranslation
else:
if any(ord(c) >= 128 for c in ''.join(domainlist)) and 'idna' not in sys.modules:
log("Unicode domain(s) found but IDNA names could not be translated due to missing idna module", error=True)
except Exception as e:
log("Unicode domain(s) found but IDNA names could not be translated due to error: {}".format(e), error=True)
return [(x, x) for x in domainlist]