Fix utf8 encoding when reading files

This commit is contained in:
VirtuBox
2019-09-01 23:29:23 +02:00
parent e9d59dacf1
commit e4f686a9f4
8 changed files with 65 additions and 62 deletions

View File

@@ -1335,10 +1335,8 @@ def doCleanupAction(self, domain='', webroot='', dbname='', dbuser='',
if os.path.isfile('/etc/nginx/sites-available/{0}'
.format(domain)):
removeNginxConf(self, domain)
if (os.path.isdir('/etc/letsencrypt/renewal/{0}_ecc'
.format(domain)) or
os.path.isdir('/etc/letsencrypt/live/{0}'
.format(domain))):
if os.path.isdir('/etc/letsencrypt/renewal/{0}_ecc'
.format(domain)):
removeAcmeConf(self, domain)
if webroot:
@@ -1486,7 +1484,7 @@ def checkWildcardExist(self, wo_domain_name):
# define new csv dialect
csv.register_dialect('acmeconf', delimiter='|')
# open file
certfile = open('/var/lib/wo/cert.csv', mode='rt', encoding='utf-8')
certfile = open('/var/lib/wo/cert.csv', mode='r', encoding='utf-8')
reader = csv.reader(certfile, 'acmeconf')
wo_wildcard_domain = ("*.{0}".format(wo_domain_name))
for row in reader: