Skip to content

Fix save failures caused by invalid filename characters - #107

Open
LingYi-Liang wants to merge 1 commit into
MiniMax-AI:mainfrom
LingYi-Liang:fix/text-output-filenames
Open

LingYi-Liang wants to merge 1 commit into
MiniMax-AI:mainfrom
LingYi-Liang:fix/text-output-filenames

Conversation

@LingYi-Liang

@LingYi-Liang LingYi-Liang commented Oct 3, 2026 •

Copy link
Copy Markdown

Fixes #106.

Text such as 2026/10/03 produces path separators in the generated filename, so saving fails even when the output directory exists and is writable.

Replace path separators, Windows-invalid characters and ASCII control characters in the text fragment with underscores. Unicode text (including Chinese), the existing first-10-character truncation, and full video task IDs are preserved.

The same replacement rules apply on all platforms, so : and ? are also replaced on systems such as Linux where those characters are allowed.

Added 30 filename regression cases that write files in temporary directories. On Windows with Python 3.11.9, all 36 tests pass, including the existing six utility tests; the original code fails 22. No model API calls were made.

Run:

python -m pytest -q -o addopts= tests/test_output_filenames.py tests/test_utils.py

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@LingYi-Liang LingYi-Liang changed the title 修复输出文件名中的特殊字符导致保存失败 Fix save failures caused by invalid filename characters Oct 4, 2026
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.

[Bug for MCP&API]: Slashes in text break local output file saving

1 participant