[PR #3191] fix(code_executor): surrogates not allowed error in jinja2 template #24025

Closed
opened 2026-02-21 20:22:13 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/3191

State: closed
Merged: Yes


Description

This commit fixes a bug related to "surrogates not allowed" error in Jinja2 template rendering by setting ensure_ascii=False in JSON dumps across various transformers. Ensures non-ASCII characters are correctly handled during the code execution process.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Dev env

Before

Xnip2024-03-25_09-36-21

After

Capture-2024-03-25-093436

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
**Original Pull Request:** https://github.com/langgenius/dify/pull/3191 **State:** closed **Merged:** Yes --- # Description This commit fixes a bug related to "surrogates not allowed" error in Jinja2 template rendering by setting `ensure_ascii=False` in JSON dumps across various transformers. Ensures non-ASCII characters are correctly handled during the code execution process. ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue) # How Has This Been Tested? - [X] Dev env ### Before ![Xnip2024-03-25_09-36-21](https://github.com/langgenius/dify/assets/14071051/9da87a89-9091-4f93-9840-b1fbb91cf55f) ### After ![Capture-2024-03-25-093436](https://github.com/langgenius/dify/assets/14071051/513b2e2e-bd45-4281-a2bd-dd387cdbec98) # Suggested Checklist: - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings
yindo added the pull-request label 2026-02-21 20:22:13 -05:00
yindo closed this issue 2026-02-21 20:22:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#24025