Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode zappa invoke output regardless of --no-color option #1069

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

rolandcrosby-check
Copy link
Contributor

Description

When a user calls zappa invoke or zappa manage, always decode the output's LogResult as UTF-8, regardless of whether the use has specified --no-color. If the output cannot be decoded as UTF-8, fall back to printing the raw bytes as a b'' literal.

Also disables colorization if the output is not being written to a terminal.

GitHub Issues

Fixes #1068.

hellno
hellno previously approved these changes Nov 8, 2021
Copy link
Collaborator

@hellno hellno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed issue and great PR 🙌🏼🙌🏼
looks good to me!

@coveralls
Copy link

coveralls commented Nov 8, 2021

Coverage Status

Coverage increased (+0.2%) to 73.527% when pulling 4b41a4e on rolandcrosby-check:no-color-decode into d0d03d5 on zappa:master.

@rolandcrosby-check
Copy link
Contributor Author

@hellno TFTR! Let me know if you think this needs a test before you can merge it; I see that coverage went down but I didn't see any existing test that this could fit into neatly.

@rolandcrosby-check
Copy link
Contributor Author

Slightly refactored and added a test so this should no longer cause issues with reduced coverage.

When a user calls `zappa invoke` or `zappa manage`, always decode the
output's `LogResult` as UTF-8, regardless of whether the use has
specified `--no-color`. If the output cannot be decoded as UTF-8, fall
back to printing the raw bytes as a `b''` literal.

Also disables colorization if the output is not being written to a
terminal.
@rolandcrosby-check
Copy link
Contributor Author

@wrboyce Just resolved the merge conflict; let me know if you need anything else from me to merge this.

@javulticat javulticat merged commit b5b80cf into zappa:master Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zappa invoke --no-color should decode result before printing
5 participants