aws / aws/aws-cli

Unnecessary stderr output on invoking `aws.cmd` with no system level association with `.py` files

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

Description

### Describe the feature

The call to associated `.py` produces unnecessary stderr output every time `aws.cmd` is invoked if there are no system-level associations with .py files, eg.
```
File association not found for extension .py
```

### Use Case

Customers may have `.py` extensions set to open with their code editor of choice, but it should also be used as the Python interpreter.

### Proposed Solution

- We can suppress the error output by redirecting the stderr output to the NUL device (similar to what you would do in POSIX environments).
- This has no effect on the "happy case" where file associations do exist.

### Other Information

The aws.cmd script itself doesn't support other use-cases such as running under `pipx` (see: https://github.com/pypa/pipx/issues/719).

> Original PR: https://github.com/aws/aws-cli/pull/6449

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CLI version used

n/a

### Environment details (OS name and version, etc.)

n/a

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.