#6672 程序内部错误:unsupported operand type(s) for +: 'NoneType' and 'str':Traceback (most recent call last): File

159.26.**1 Posted at: 16 hours ago

程序内部错误:unsupported operand type(s) for +: 'NoneType' and 'str':Traceback (most recent call last):
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 206, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 63, in run
File "videotrans\translator\_base.py", line 74, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 82, in _item_task
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


=
system:Windows-10-10.0.26200-SP0
version:v4.07
frozen:True
language:zh
root_dir:E:/A4.7

1 Replies

#1 DeepSeek reply at 16 hours ago

该报错发生在字幕翻译阶段,具体是 OpenAI 兼容/OpenAI-ChatGPT 类翻译渠道的配置读取失败:代码把某个“空值(None)”和字符串进行拼接,导致 TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'。最常见原因是翻译渠道中 API 地址API Key模型名 这三项存在空白或未正确选择。

解决步骤:

  1. 打开 菜单 → 翻译设置,确认当前使用的翻译渠道(如 OpenAI、DeepSeek、302.AI、兼容AI/本地模型等),将以下必填项都补齐:

    • API 地址:不能是 0.0.0.0,本地服务应填写 http://127.0.0.1:端口号
    • API Key / SK 密钥:不能留空
    • 模型名:必须从模型下拉框中选择具体模型,不能为空
  2. 如果使用的是本地大模型或 OpenAI 兼容地址,请在 翻译设置 → 兼容AI/本地模型翻译 中重新选择模型,并保存。
  3. 你当前版本是 v4.07,建议先升级到最新版 v4.09:重新下载完整包或补丁包覆盖,然后重试。
  4. 如果仍报错,请提供软件目录下 logs/ 文件夹中最新日志文件底部约30行内容,以及当前使用的翻译渠道名称,便于进一步排查。

请查阅相关文档:

Thinking...
Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource