at 17.09-beta 20 lines 905 B view raw
1--- a/certdata2pem.py 2017-08-01 23:10:00.000000000 +0300 2+++ b/certdata2pem.py 2017-08-01 23:08:21.131297636 +0300 3@@ -88,7 +88,7 @@ 4 \# Read blacklist. 5 blacklist = [] 6 if os.path.exists('blacklist.txt'): 7- for line in open('blacklist.txt', 'r'): 8+ for line in io.open('blacklist.txt', 'r', encoding='utf-8'): 9 line = line.strip() 10 if line.startswith('#') or len(line) == 0: 11 continue 12@@ -101,7 +101,7 @@ 13 if obj['CKA_CLASS'] != 'CKO_NSS_TRUST': 14 continue 15 if obj['CKA_LABEL'] in blacklist: 16- print("Certificate %s blacklisted, ignoring." % obj['CKA_LABEL']) 17+ print("Certificate %s blacklisted, ignoring." % unicode(obj['CKA_LABEL']).encode('utf-8')) 18 elif obj['CKA_TRUST_SERVER_AUTH'] == 'CKT_NSS_TRUSTED_DELEGATOR': 19 trust[obj['CKA_LABEL']] = True 20 elif obj['CKA_TRUST_EMAIL_PROTECTION'] == 'CKT_NSS_TRUSTED_DELEGATOR':