From 2ad818ed3b8c1eabcadeaa697ede3ff07ad16144 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 25 Oct 2025 01:33:18 +0200 Subject: [PATCH] Remove another pylint ignore. --- .pylintrc | 1 - plugins/action/docker_container_copy_into.py | 1 + plugins/connection/nsenter.py | 1 + plugins/module_utils/_api/api/client.py | 2 ++ plugins/module_utils/_api/transport/basehttpadapter.py | 2 ++ plugins/module_utils/_api/transport/ssladapter.py | 4 ++++ 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index fe23bb35..1c50e2ad 100644 --- a/.pylintrc +++ b/.pylintrc @@ -383,7 +383,6 @@ disable=raw-checker-failed, consider-using-with, fixme, import-error, # TODO figure out why pylint cannot find the module - no-member, no-name-in-module, # TODO figure out why pylint cannot find the module protected-access, redefined-outer-name, # needed for test fixtures diff --git a/plugins/action/docker_container_copy_into.py b/plugins/action/docker_container_copy_into.py index ca11d553..25306d43 100644 --- a/plugins/action/docker_container_copy_into.py +++ b/plugins/action/docker_container_copy_into.py @@ -29,6 +29,7 @@ class ActionModule(ActionBase): result = super().run(tmp, task_vars) del tmp # tmp no longer has any effect + # pylint: disable-next=no-member max_file_size_for_diff: int = C.MAX_FILE_SIZE_FOR_DIFF # type: ignore self._task.args["_max_file_size_for_diff"] = max_file_size_for_diff diff --git a/plugins/connection/nsenter.py b/plugins/connection/nsenter.py index db3bb1f9..41833649 100644 --- a/plugins/connection/nsenter.py +++ b/plugins/connection/nsenter.py @@ -92,6 +92,7 @@ class Connection(ConnectionBase): display.debug("in nsenter.exec_command()") + # pylint: disable-next=no-member def_executable: str | None = C.DEFAULT_EXECUTABLE # type: ignore[attr-defined] executable = def_executable.split()[0] if def_executable else None diff --git a/plugins/module_utils/_api/api/client.py b/plugins/module_utils/_api/api/client.py index 622b4539..2457dfea 100644 --- a/plugins/module_utils/_api/api/client.py +++ b/plugins/module_utils/_api/api/client.py @@ -652,6 +652,8 @@ class APIClient(_Session): def get_adapter(self, url: str) -> BaseAdapter: try: + # pylint finds our Session stub instead of requests.Session: + # pylint: disable-next=no-member return super().get_adapter(url) except _InvalidSchema as e: if self._custom_adapter: diff --git a/plugins/module_utils/_api/transport/basehttpadapter.py b/plugins/module_utils/_api/transport/basehttpadapter.py index 90239199..53dc5e3e 100644 --- a/plugins/module_utils/_api/transport/basehttpadapter.py +++ b/plugins/module_utils/_api/transport/basehttpadapter.py @@ -16,6 +16,8 @@ from .._import_helper import HTTPAdapter as _HTTPAdapter class BaseHTTPAdapter(_HTTPAdapter): def close(self) -> None: + # pylint finds our HTTPAdapter stub instead of requests.adapters.HTTPAdapter: + # pylint: disable-next=no-member super().close() if hasattr(self, "pools"): self.pools.clear() diff --git a/plugins/module_utils/_api/transport/ssladapter.py b/plugins/module_utils/_api/transport/ssladapter.py index 3d1d674e..8c6c728a 100644 --- a/plugins/module_utils/_api/transport/ssladapter.py +++ b/plugins/module_utils/_api/transport/ssladapter.py @@ -58,7 +58,11 @@ class SSLHTTPAdapter(BaseHTTPAdapter): We already take care of a normal poolmanager via init_poolmanager But we still need to take care of when there is a proxy poolmanager + + Note that this method is no longer called for newer requests versions. """ + # pylint finds our HTTPAdapter stub instead of requests.adapters.HTTPAdapter: + # pylint: disable-next=no-member conn = super().get_connection(*args, **kwargs) if ( self.assert_hostname is not None