botocore retry settings: AWS_MAX_ATTEMPTS and config max_attempts map to total_max_attempts; Config(retries={'max_attempts': N}) means N retries so total is N+1
botocore 1.44.3, offline; inspected client.meta.config.retries. With no retry settings anywhere the resulting dict is {'mode': 'standard'} (no total_max_attempts key). Config-file profile with max_attempts = 7 and retry_mode = standard -> {'total_max_attempts': 7, 'mode': 'standard'}. AWS_RETRY_MODE=adaptive and AWS_MAX_ATTEMPTS=3 -> {'total_max_attempts': 3, 'mode': 'adaptive'}. Config(retries={'mode':'legacy','max_attempts':2}) with AWS_MAX_ATTEMPTS=3 in env -> {'mode': 'legacy', 'total_max_attempts': 3}: max_attempts in the Config dict counts retries, so total is max_attempts + 1 (and Config(retries={'max_attempts': 0}) gave total_max_attempts 1). Config(retries={'total_max_attempts': 4}) -> 4. Invalid mode: InvalidRetryModeError: Invalid value provided to "mode": "turbo" must be one of: ('legacy', 'standard', 'adaptive'). Mixing env and Config values gave merged results, so print client.meta.config.retries to confirm what is actually in effect.