Description
Describe the bug
In case you create a duplication of an existing profile, aws-cli just reports "Unable to parse config file .aws/config" without any clue of the offending profile.
It would make sense to report the line number and the source reason of parse failure which may be difficult to guess when working with few hundreds of lines in configuration.
Thank you in advance
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
It would make sense to report the line number and the source reason of parsing failure: duplicated profile "xxx" at line yyy
Current Behavior
Reports only: Unable to parse config file: C:\Users\zzzzzz/.aws/config
Reproduction Steps
Duplicate a profile with same name in .aws/config
for instance
[profile test]
region = eu-central-1
output = json
[profile test]
region = eu-central-1
output = json
Possible Solution
A fix suggestion: reports line number and the source reason of parse failure:
Unable to parse config file: C:\Users\zzzzzz/.aws/config`. Duplicated declaration of profile 'test' at line 5.
Additional Information/Context
No response
CLI version used
aws-cli/2.23.3 Python/3.12.6 Windows/11 exe/AMD64
Environment details (OS name and version, etc.)
Windows 11