Skip to content

Conversation

@pengfeiye
Copy link
Contributor

@pengfeiye pengfeiye commented Jan 15, 2026

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.


Note

Improves request JSON encoding and expands tests.

  • In HttpClient._execute, serialize request_body with json.dumps(..., ensure_ascii=False, allow_nan=True) and send as UTF-8 encoded bytes to prevent Latin-1 errors and preserve special characters; keep data path unchanged (e.g., multipart)
  • Adjust request invocation to use data= with bytes when JSON is present; honor override timeouts
  • Add/modify tests to validate UTF-8 bytes handling (emoji, accented characters, right single quotation mark), NaN/Infinity serialization, None body/data behavior, and multipart unaffected
  • Update CHANGELOG.md under Unreleased to note UTF-8 fix

Written by Cursor Bugbot for commit 103c3b6. This will update automatically on new commits. Configure here.

@pengfeiye pengfeiye changed the title v6.13.1-release Update json data dump to encode utf-8 to avoid Latin-1 encoding error in the HTTP layer Jan 15, 2026
@pengfeiye pengfeiye force-pushed the CUST-5053-sdk-python-sdk-v-6-13-1-unicode-encode-error-regression branch from d89ab47 to 3ee9789 Compare January 15, 2026 23:18
@pengfeiye pengfeiye changed the title Update json data dump to encode utf-8 to avoid Latin-1 encoding error in the HTTP layer Update to use requests' json parameter for proper UTF-8 handling when sending JSON Jan 15, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@pengfeiye pengfeiye changed the title Update to use requests' json parameter for proper UTF-8 handling when sending JSON Fix UTF-8 encoding for special characters (emoji, accented letters, etc.) by encoding JSON as UTF-8 bytes Jan 16, 2026
@pengfeiye pengfeiye merged commit 75687c9 into main Jan 16, 2026
8 checks passed
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.

3 participants