Azure / Azure/azure-cli

Unable to download Blob on Mac OS UTF-8

Open
#17,868 3 comments 0 reactions 1 assignee Claimed by @Juliehzl View on GitHub
act-codegen-extensibility-squad Service Attention Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

**Command Name**
`az storage blob download`

**Errors:**
```
'utf-8' codec can't encode characters in position 2-3: surrogates not allowed
Traceback (most recent call last):
python3.8/site-packages/knack/cli.py, ln 233, in invoke
cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 660, in execute
raise ex
cli/core/commands/__init__.py, ln 723, in _run_jobs_serially
...
return self._perform_request(request, _parse_blob,
storage/v2018_11_09/common/storageclient.py, ln 284, in _perform_request
_update_request(request, self._X_MS_VERSION, self._USER_AGENT_STRING)
storage/v2018_11_09/common/_serialization.py, ln 74, in _update_request
request.path = url_quote(request.path, '/()$=\',~')
lib/python3.8/urllib/parse.py, ln 844, in quote
string = string.encode(encoding, errors)
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 2-3: surrogates not allowed
```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- _Put any pre-requisite steps here..._
- `az storage blob download --account-name {} --container-name {} --name {} --file {}`

## Expected Behavior

## Environment Summary
```
macOS-11.2.1-x86_64-i386-64bit
Python 3.8.9
Installer: HOMEBREW

azure-cli 2.21.0 *

Extensions:
webapp 0.3.1

```
## Additional Context

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.