From c0b63353111f514335830d4e80ae483e580ce19c Mon Sep 17 00:00:00 2001 From: "Matthew X. Economou" Date: Fri, 12 Jan 2024 20:00:49 -0500 Subject: [PATCH 1/2] Reproduce subprocess error when credential_process set to empty string --- tests/unit/test_credentials.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unit/test_credentials.py b/tests/unit/test_credentials.py index 089fcc8695..d159e7e4a1 100644 --- a/tests/unit/test_credentials.py +++ b/tests/unit/test_credentials.py @@ -3225,6 +3225,13 @@ def test_process_not_invoked_if_not_configured_for_empty_config(self): provider = self.create_process_provider() self.assertIsNone(provider.load()) + def test_process_not_invoked_if_set_to_empty_string(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': ''} + } + provider = self.create_process_provider() + self.assertIsNone(provider.load()) + def test_can_retrieve_via_process(self): self.loaded_config['profiles'] = { 'default': {'credential_process': 'my-process'} From 382da175bb7e0a615c5211ddd40cd34094a5fee2 Mon Sep 17 00:00:00 2001 From: "Matthew X. Economou" Date: Fri, 12 Jan 2024 20:02:10 -0500 Subject: [PATCH 2/2] Do not retrieve credentials from credential_process when set to empty string Fixes boto/botocore#3098. --- botocore/credentials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botocore/credentials.py b/botocore/credentials.py index 42707b0124..6d78d50806 100644 --- a/botocore/credentials.py +++ b/botocore/credentials.py @@ -994,7 +994,7 @@ def __init__(self, profile_name, load_config, popen=subprocess.Popen): def load(self): credential_process = self._credential_process - if credential_process is None: + if not credential_process: return creds_dict = self._retrieve_credentials_using(credential_process)