The following issues were found
certbot/tests/compat/os_test.py
2 issues
Line: 4
Column: 1
"""Unit test for os module."""
import unittest
from certbot.compat import os
class OsTest(unittest.TestCase):
"""Unit tests for os module."""
def test_forbidden_methods(self):
Reported by Pylint.
Line: 9
Column: 5
class OsTest(unittest.TestCase):
"""Unit tests for os module."""
def test_forbidden_methods(self):
# Checks for os module
for method in ['chmod', 'chown', 'open', 'mkdir', 'makedirs', 'rename',
'replace', 'access', 'stat', 'fstat']:
self.assertRaises(RuntimeError, getattr(os, method))
# Checks for os.path module
Reported by Pylint.
certbot-dns-cloudxns/setup.py
2 issues
Line: 1
Column: 1
import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
Reported by Pylint.
Line: 7
Column: 1
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
'dns-lexicon>=3.2.1',
'setuptools>=39.0.1',
]
Reported by Pylint.
certbot/certbot/_internal/reporter.py
2 issues
Line: 31
Column: 24
_msg_type = collections.namedtuple('_msg_type', 'priority text on_crash')
def __init__(self, config):
self.messages: queue.PriorityQueue[Reporter._msg_type] = queue.PriorityQueue()
self.config = config
def add_message(self, msg, priority, on_crash=True):
"""Adds msg to the list of messages to be printed.
Reported by Pylint.
Line: 46
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
printed if the program exits abnormally.
"""
assert self.HIGH_PRIORITY <= priority <= self.LOW_PRIORITY
self.messages.put(self._msg_type(priority, msg, on_crash))
logger.debug("Reporting to user: %s", msg)
def print_messages(self):
"""Prints messages to the user and clears the message queue.
Reported by Bandit.
certbot/certbot/_internal/cli/__init__.py
2 issues
Line: 54
Column: 1
helpful_parser: Optional[HelpfulArgumentParser] = None
def prepare_and_parse_args(plugins, args, detect_defaults=False):
"""Returns parsed command line arguments.
:param .PluginsRegistry plugins: available plugins
:param list args: command line arguments with the program name removed
Reported by Pylint.
Line: 434
Column: 9
_plugins_parsing(helpful, plugins)
if not detect_defaults:
global helpful_parser # pylint: disable=global-statement
helpful_parser = helpful
return helpful.parse_args()
def set_by_cli(var):
Reported by Pylint.
certbot-ci/certbot_integration_tests/assets/hook.py
2 issues
Line: 1
Column: 1
#!/usr/bin/env python
import os
import sys
hook_script_type = os.path.basename(os.path.dirname(sys.argv[1]))
if hook_script_type == 'deploy' and ('RENEWED_DOMAINS' not in os.environ or 'RENEWED_LINEAGE' not in os.environ):
sys.stderr.write('Environment variables not properly set!\n')
sys.exit(1)
Reported by Pylint.
Line: 6
Column: 1
import sys
hook_script_type = os.path.basename(os.path.dirname(sys.argv[1]))
if hook_script_type == 'deploy' and ('RENEWED_DOMAINS' not in os.environ or 'RENEWED_LINEAGE' not in os.environ):
sys.stderr.write('Environment variables not properly set!\n')
sys.exit(1)
print(hook_script_type)
Reported by Pylint.
certbot-compatibility-test/certbot_compatibility_test/interfaces.py
2 issues
Line: 5
Column: 1
from abc import ABCMeta
from abc import abstractmethod
from certbot import interfaces
class PluginProxy(interfaces.Plugin, metaclass=ABCMeta):
"""Wraps a Certbot plugin"""
Reported by Pylint.
Line: 64
Column: 1
"""Wraps a Certbot configurator"""
class Configurator(interfaces.Installer, interfaces.Authenticator, metaclass=ABCMeta):
"""Represents a plugin that has both Installer and Authenticator capabilities"""
Reported by Pylint.
acme/tests/test_util.py
2 issues
Line: 10
Column: 1
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import josepy as jose
from OpenSSL import crypto
import pkg_resources
def load_vector(*names):
Reported by Pylint.
Line: 24
Column: 5
def _guess_loader(filename, loader_pem, loader_der):
_, ext = os.path.splitext(filename)
if ext.lower() == '.pem':
return loader_pem
elif ext.lower() == '.der':
return loader_der
raise ValueError("Loader could not be recognized based on extension") # pragma: no cover
Reported by Pylint.
certbot-nginx/setup.py
2 issues
Line: 1
Column: 1
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
# We specify the minimum acme and certbot version as the current plugin
# version for simplicity. See
# https://github.com/certbot/certbot/issues/8761 for more info.
Reported by Pylint.
Line: 4
Column: 1
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
# We specify the minimum acme and certbot version as the current plugin
# version for simplicity. See
# https://github.com/certbot/certbot/issues/8761 for more info.
Reported by Pylint.
certbot-dns-sakuracloud/setup.py
2 issues
Line: 1
Column: 1
import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
Reported by Pylint.
Line: 7
Column: 1
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
'dns-lexicon>=3.2.1',
'setuptools>=39.0.1',
]
Reported by Pylint.
certbot-dns-cloudflare/setup.py
2 issues
Line: 1
Column: 1
import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
Reported by Pylint.
Line: 7
Column: 1
from setuptools import find_packages
from setuptools import setup
version = '1.19.0.dev0'
install_requires = [
'cloudflare>=1.5.1',
'setuptools>=39.0.1',
]
Reported by Pylint.