commit: e1f146ff766ca585ec87f7eba3cf22c7da986c22 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Tue Nov 11 19:24:52 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Nov 13 06:32:22 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e1f146ff
sync: fix pickle error for noisy_refresh_keys Bug: https://bugs.gentoo.org/965969 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/portage/sync/syncbase.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py index fecfc00690..2419bbe339 100644 --- a/lib/portage/sync/syncbase.py +++ b/lib/portage/sync/syncbase.py @@ -1,4 +1,4 @@ -# Copyright 2014-2023 Gentoo Authors +# Copyright 2014-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 """ @@ -305,18 +305,9 @@ class SyncBase: ) else: - def noisy_refresh_keys(): - """ - Since retry does not help for some types of - errors, display errors as soon as they occur. - """ - try: - openpgp_env.refresh_keys_keyserver( - keyserver=self.repo.sync_openpgp_keyserver - ) - except Exception as e: - writemsg_level(f"{e}\n", level=logging.ERROR, noiselevel=-1) - raise # retry + noisy_refresh_keys = functools.partial( + self._noisy_refresh_keys, openpgp_env, self.repo.sync_openpgp_keyserver + ) # The ThreadPoolExecutor that asyncio uses by default # does not support cancellation of tasks, therefore @@ -331,6 +322,17 @@ class SyncBase: loop.run_until_complete(decorated_func()) out.eend(0) + @staticmethod + def _noisy_refresh_keys(openpgp_env, keyserver): + """ + Since retry does not help for some types of errors, display errors as soon as they occur. + """ + try: + openpgp_env.refresh_keys_keyserver(keyserver=keyserver) + except Exception as e: + writemsg_level(f"{e}\n", level=logging.ERROR, noiselevel=-1) + raise # retry + def _get_openpgp_env(self, openpgp_key_path=None, debug=False): if gemato is not None: # Override global proxy setting with one provided in emerge configuration
