Skip to content

fix(sdk-python): Preserve invalid UTF-8 error payloads#368

Merged
ninan-nn merged 1 commit intoalibaba:mainfrom
Gujiassh:fix/python-error-body-parse
Mar 9, 2026
Merged

fix(sdk-python): Preserve invalid UTF-8 error payloads#368
ninan-nn merged 1 commit intoalibaba:mainfrom
Gujiassh:fix/python-error-body-parse

Conversation

@Gujiassh
Copy link
Copy Markdown
Contributor

@Gujiassh Gujiassh commented Mar 6, 2026

Summary

  • treat empty byte/string error bodies as missing payloads instead of decoding them
  • decode invalid UTF-8 bytes with replacement characters so callers still receive an actionable fallback error message
  • add regression coverage for invalid UTF-8 payload parsing

Testing

  • python3 -m pytest tests/test_converters_and_error_handling.py -q

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 6, 2026

CLA assistant check
All committers have signed the CLA.

@Pangjiping Pangjiping added bug Something isn't working sdk/python labels Mar 6, 2026
Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

LGTM

@jwx0925
Copy link
Copy Markdown
Collaborator

jwx0925 commented Mar 9, 2026

@codex review

Copy link
Copy Markdown
Collaborator

@ninan-nn ninan-nn left a comment

Choose a reason for hiding this comment

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

LGTM

@ninan-nn ninan-nn merged commit 40b17ef into alibaba:main Mar 9, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sdk/python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants