[PR #594] fix: Asynchronous Pipeline Support and explicit use of utf-8 encoding when reading module files #479

Open
opened 2026-10-18 21:06:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/pipelines/pull/594
Author: @lizhenisu
Created: 2/21/2026
Status: 🔄 Open

Base: main ← Head: main


📝 Commits (2)

  • eeafc0e fix: explicit use of utf-8 encoding when reading module files
  • 879d7f7 feat: Asynchronous Pipeline Support

📊 Changes

1 file changed (+113 additions, -3 deletions)

View changed files

📝 main.py (+113 -3)

📄 Description

The Issue

Fix: Force UTF-8 encoding when loading pipeline modules to resolve UnicodeDecodeError on Windows

On Windows, the default encoding for open() is often system-dependent (e.g., GBK or CP1252). If a user writes a custom pipe function containing UTF-8 characters (like Chinese prompts), the loader fails to read the file, raising a UnicodeDecodeError.

Error Log:

UnicodeDecodeError: 'gbk' codec can't decode byte 0x97 in position ...: illegal multibyte sequence

Reproduction Steps

  1. On a Windows machine.
  2. Create a custom pipeline file with the following content (containing Chinese characters):
# ... inside the pipe function
ollama_messages = [
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "把图片内容转成文字"}, # <--- This triggers the error
            image_part
        ]
    }
]
# ...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/pipelines/pull/594 **Author:** [@lizhenisu](https://github.com/lizhenisu) **Created:** 2/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`eeafc0e`](https://github.com/open-webui/pipelines/commit/eeafc0ed3c2b182534c47b5ab6a098d1e9b9c9e8) fix: explicit use of utf-8 encoding when reading module files - [`879d7f7`](https://github.com/open-webui/pipelines/commit/879d7f77f8f41f71bcc0eae4ebd2d806212e273b) feat: Asynchronous Pipeline Support ### 📊 Changes **1 file changed** (+113 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+113 -3) </details> ### 📄 Description ### The Issue Fix: Force UTF-8 encoding when loading pipeline modules to resolve `UnicodeDecodeError` on Windows On Windows, the default encoding for `open()` is often system-dependent (e.g., `GBK` or `CP1252`). If a user writes a custom `pipe` function containing UTF-8 characters (like Chinese prompts), the loader fails to read the file, raising a `UnicodeDecodeError`. **Error Log:** ``` UnicodeDecodeError: 'gbk' codec can't decode byte 0x97 in position ...: illegal multibyte sequence ``` ### Reproduction Steps 1. On a Windows machine. 2. Create a custom pipeline file with the following content (containing Chinese characters): ```python # ... inside the pipe function ollama_messages = [ { "role": "user", "content": [ {"type": "text", "text": "把图片内容转成文字"}, # <--- This triggers the error image_part ] } ] # ... ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/pipelines#479
No description provided.