Repository navigation
fix: 保存路径支持空格(#447) - #519
Open
zzuu080603 wants to merge 1 commit into
Open
zzuu080603 wants to merge 1 commit into
zzuu080603 wants to merge 1 commit into
Conversation
On Linux/Docker _get_save_path rewrote every space of the output directory to an underscore, silently recording into a different, underscore-named directory than the one the user configured. Spaces are valid path characters everywhere (ffmpeg receives argv as a list), so the rewrite is removed; the filename itself keeps the long-standing underscore normalization. Passing a spaced path through required also fixing the custom-script plumbing, which only appeared to quote arguments: the command string was split on whitespace and executed with create_subprocess_exec (no shell), so quotes were literal characters and any spaced argument would shatter into multiple argv entries. custom_script_execute now builds a real argument list and run_script_async accepts a list (or a legacy string via shlex), passing spaced paths as single arguments. Verified end-to-end with a subprocess probe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 标题(Title)
🔍 描述(Description)
问题 1:Linux/Docker 下保存路径的空格被改写(#447)
_get_save_path中sys.platform == 'linux'时将整个输出目录的空格替换为下划线——用户配置…/live live会被静默录制到…/live_live。ffmpeg 通过 argv 列表接收路径,空格在所有平台均合法,该改写无必要,已删除。文件名部分保留原有的下划线规范化(与本次 issue 无关的既定行为)。问题 2:自定义脚本的"引号"从未生效(顺带修复,路径空格的必要配套)
原实现把参数拼进命令字符串(
--save_file_path \"…\"),再由run_script_async用command.split()切分后交给create_subprocess_exec(非 shell 执行):现在
custom_script_execute直接构建参数列表,run_script_async接收列表(兼容旧字符串,经shlex.split解析),带空格路径作为单一参数传递。已用真实子进程探针端到端验证。📝 类型(Type of Change)
🏗️ 测试(Testing)
行为级验证(加载真实源码,11/11 通过):
_get_save_path('D:/live live/recordings')目录部分保留空格;文件名空格仍规范化;分段后缀_%03d.ts正常custom_script_execute(python/非 python 分支)产出 argv 列表:带空格保存路径为单一参数、无字面引号、--save_file_path与值成对create_subprocess_exec+ argv 列表执行子进程探针,确认收到完整的带空格路径参数已知边界(与原版一致,非本次回归):自定义脚本命令本身含空格时仍会按空白切分,用户应使用无空格的脚本路径。
📋 检查清单(Checklist)
Fixes #447