mirror of
https://github.com/certbot/certbot.git
synced 2026-07-26 07:39:52 +02:00
Use UTF-8 encoding for nginx plugin
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""NginxParser is a member object of the NginxConfigurator class."""
|
||||
import copy
|
||||
import codecs
|
||||
import functools
|
||||
import glob
|
||||
import logging
|
||||
@@ -205,7 +206,7 @@ class NginxParser(object):
|
||||
if item in self.parsed and not override:
|
||||
continue
|
||||
try:
|
||||
with open(item) as _file:
|
||||
with codecs.open(item, "r", "utf-8") as _file:
|
||||
parsed = nginxparser.load(_file)
|
||||
self.parsed[item] = parsed
|
||||
trees.append(parsed)
|
||||
@@ -414,7 +415,7 @@ class NginxParser(object):
|
||||
def _parse_ssl_options(ssl_options):
|
||||
if ssl_options is not None:
|
||||
try:
|
||||
with open(ssl_options) as _file:
|
||||
with codecs.open(ssl_options, "r", "utf-8") as _file:
|
||||
return nginxparser.load(_file)
|
||||
except IOError:
|
||||
logger.warning("Missing NGINX TLS options file: %s", ssl_options)
|
||||
|
||||
Reference in New Issue
Block a user