mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Fix lint problems with long lines
This commit is contained in:
@@ -213,7 +213,9 @@ class NginxParser(object):
|
||||
except IOError:
|
||||
logger.warning("Could not open file: %s", item)
|
||||
except UnicodeDecodeError:
|
||||
logger.warning("Could not read file: %s due to invalid unicode character. Only UTF-8 encoding is supported.", item)
|
||||
logger.warning("Could not read file: %s due to invalid "
|
||||
"character. Only UTF-8 encoding is "
|
||||
"supported.", item)
|
||||
except pyparsing.ParseException as err:
|
||||
logger.debug("Could not parse file: %s due to %s", item, err)
|
||||
return trees
|
||||
@@ -422,7 +424,8 @@ def _parse_ssl_options(ssl_options):
|
||||
except IOError:
|
||||
logger.warning("Missing NGINX TLS options file: %s", ssl_options)
|
||||
except UnicodeDecodeError:
|
||||
logger.warn("Could not read file: %s due to invalid unicode character. Only UTF-8 encoding is supported.", ssl_options)
|
||||
logger.warn("Could not read file: %s due to invalid character. "
|
||||
"Only UTF-8 encoding is supported.", ssl_options)
|
||||
except pyparsing.ParseBaseException as err:
|
||||
logger.debug("Could not parse file: %s due to %s", ssl_options, err)
|
||||
return []
|
||||
|
||||
@@ -485,14 +485,16 @@ class NginxParserTest(util.NginxTest):
|
||||
def test_valid_unicode_characters(self):
|
||||
nparser = parser.NginxParser(self.config_path)
|
||||
# pylint: disable=protected-access
|
||||
parsed = nparser._parse_files(nparser.abs_path('unicode_support/valid_unicode_comments.conf'))
|
||||
path = nparser.abs_path('unicode_support/valid_unicode_comments.conf')
|
||||
parsed = nparser._parse_files(path)
|
||||
self.assertEqual(['server'], parsed[0][2][0])
|
||||
self.assertEqual(['listen', '80'], parsed[0][2][1][3])
|
||||
|
||||
def test_invalid_unicode_characters(self):
|
||||
nparser = parser.NginxParser(self.config_path)
|
||||
# pylint: disable=protected-access
|
||||
parsed = nparser._parse_files(nparser.abs_path('unicode_support/invalid_unicode_comments.conf'))
|
||||
path = nparser.abs_path('unicode_support/invalid_unicode_comments.conf')
|
||||
parsed = nparser._parse_files(path)
|
||||
self.assertEqual([], parsed)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user