diff --git a/botocore/regions.py b/botocore/regions.py index 569830ae0d..d3b2705727 100644 --- a/botocore/regions.py +++ b/botocore/regions.py @@ -615,7 +615,7 @@ def _resolve_param_as_operation_context_param( operation_ctx_params = operation_model.operation_context_parameters if param_name in operation_ctx_params: path = operation_ctx_params[param_name]['path'] - return tuple(jmespath.search(path, call_args)) + return jmespath.search(path, call_args) def _resolve_param_as_builtin(self, builtin_name, builtins): if builtin_name not in EndpointResolverBuiltins.__members__.values(): diff --git a/botocore/utils.py b/botocore/utils.py index fe704ff274..2d55e8a8dc 100644 --- a/botocore/utils.py +++ b/botocore/utils.py @@ -1491,6 +1491,9 @@ def func_with_weakref(weakref_to_self, *args, **kwargs): @functools.wraps(func) def inner(self, *args, **kwargs): + for kwarg_key, kwarg_value in kwargs.items(): + if isinstance(kwarg_value, list): + kwargs[kwarg_key] = tuple(kwarg_value) return func_with_weakref(weakref.ref(self), *args, **kwargs) inner.cache_info = func_with_weakref.cache_info diff --git a/tests/unit/test_endpoint_provider.py b/tests/unit/test_endpoint_provider.py index 83752f43de..3d6bf81e32 100644 --- a/tests/unit/test_endpoint_provider.py +++ b/tests/unit/test_endpoint_provider.py @@ -162,9 +162,6 @@ def ruleset_testcases(): for test in tests["testCases"]: input_params = test["params"] - for key, value in input_params.items(): - if isinstance(value, list): - input_params[key] = tuple(value) expected_object = test["expect"] if "error" in expected_object: error_cases.append(