aws / aws/aws-cli

default LANG settings in CLI Docker container image result in Unicode errors

Open
#6,461 6 comments 0 reactions 0 assignees View on GitHub
docker feature-request p3 unicode
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [ ] I've gone though the [User Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) and the [API reference](https://docs.aws.amazon.com/cli/latest/reference/)
- [ X ] I've searched for [previous similar issues](https://github.com/aws/aws-cli/issues) and didn't find any solution

**Describe the bug**
`aws ecr describe-image-scan-findings` throws a `ascii' codec can't encode character '\u2019' in position 197: ordinal not in range(128)`

**SDK version number**

**Platform/OS/Hardware/Device**
What are you running the cli on?
Using jenkins to pull in the latest `amazon/aws-cli` container.

**To Reproduce (observed behavior)**

`aws ecr describe-image-scan-findings --repository-name $repo --image-id imageTag=$imageTag --output json`

**Expected behavior**
I was expecting the command to complete.

**Logs/output**
```
"name": "CVE-2020-26559",
"description": 2021-10-08 17:37:09,392 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
File "awscli/clidriver.py", line 459, in main
File "awscli/clidriver.py", line 594, in __call__
File "awscli/clidriver.py", line 770, in __call__
File "awscli/clidriver.py", line 903, in invoke
File "awscli/clidriver.py", line 925, in _display_response
File "awscli/formatter.py", line 88, in __call__
File "awscli/formatter.py", line 107, in _format_response
File "json/__init__.py", line 180, in dump
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 197: ordinal not in range(128)

'ascii' codec can't encode character '\u2019' in position 197: ordinal not in range(128)
```

**Additional context**
I ran `locale` from the aws-cli
```
+ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.