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

feat: Use errors=replace instead of returning an empty string #556

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

mildaniel
Copy link
Contributor

Issue #, if available:
aws/aws-sam-cli#6075

Description of changes:
A previous change handled decoding errors by catching a UnicodeDecodeError and returning an empty string. Instead, a more graceful approach is to set error=replace which will replace any unrecognized characters with a replacement characters instead of throwing an exception.

https://docs.python.org/3/library/codecs.html#codec-base-classes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mildaniel mildaniel requested a review from a team as a code owner October 12, 2023 18:29
@mildaniel mildaniel requested review from jfuss and hnnasit October 12, 2023 18:29
@mildaniel mildaniel added this pull request to the merge queue Oct 12, 2023
@mildaniel mildaniel removed this pull request from the merge queue due to a manual request Oct 12, 2023
@mildaniel mildaniel added this pull request to the merge queue Oct 12, 2023
Merged via the queue into aws:develop with commit 57f5409 Oct 12, 2023
125 checks passed
@mildaniel mildaniel deleted the use-replace-errors branch October 12, 2023 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants