ERROR: 'charmap' codec can't encode characters in position 4790-4801: character maps to <undefined>
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62
**Describe the bug**
Recently, my script run into this problem. My az script is run on Azure Pipelines. Here is my PowerShell script on Windows Server 2019 agent:
```ps1
az deployment sub what-if `
--name "main$(Get-Date -Format "yyyyMMddHHmmss")" `
--location 'japaneast' `
--template-file 'main.bicep' `
--parameters `
"env=$(env.name)" `
"projectName=$(projectName)" `
"dbAdminAccount=$(sql.serveradmin.name)" `
"dbAdminPwd=$(sql.serveradmin.password)"
```
Here is the error output:
```txt
ERROR: 'charmap' codec can't encode characters in position 4790-4801: character maps to
```
For the following command, it works.
```ps1
az deployment sub validate `
--name "main$(Get-Date -Format "yyyyMMddHHmmss")" `
--location 'japaneast' `
--template-file 'main.bicep' `
--parameters `
"env=$(env.name)" `
"projectName=$(projectName)" `
"dbAdminAccount=$(sql.serveradmin.name)" `
"dbAdminPwd=$(sql.serveradmin.password)"
```
So the error only shows when running `az deployment sub what-if` command.
**To Reproduce**
**Expected behavior**
My script is running for more than 1 month. It works before. I found it's broken today.
**Environment summary**
```txt
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" --version"
azure-cli 2.32.0 *
WARNING: You have 2 updates available. Consider updating your CLI installation with 'az upgrade'
core 2.32.0 *
Please let us know how we are doing: https://aka.ms/azureclihats
telemetry 1.0.6
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
Extensions:
azure-devops 0.22.0
Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Program Files\Common Files\AzureCliExtensionDirectory'
Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
```
**Additional context**
Contributor guide
Assessment
This issue has not been assessed yet.