#3693 tenacity.RetryError: RetryError[<Future at 0x1e7b9fd5390 state=finished raised AttributeError>]

36.152* Posted at: 2 hours ago 👁5

翻译字幕阶段出错:'NoneType' object has no attribute 'lower':Traceback (most recent call last):
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_microsoft.py", line 41, in _item_task
AttributeError: 'NoneType' object has no attribute 'lower'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\job.py", line 109, in run
File "videotrans\task\_translate_srt.py", line 48, in trans
File "videotrans\translator\__init__.py", line 792, in run
File "videotrans\translator\_base.py", line 78, in run
File "videotrans\translator\_base.py", line 94, in _run_text
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[]


=
Windows-10-10.0.26200-SP0
version:v3.79
frozen:True
language:zh

1 Replies

翻译渠道“微软翻译”在处理字幕时遇到了空值(None)错误。

这是由于微软翻译渠道在处理字幕行时,某一行字幕文本为 None(空值),导致无法调用 .lower() 方法。这通常发生在字幕文件格式异常或语音识别结果存在空行时。

解决方案:

  1. 检查并清理字幕文件:在翻译阶段开始前,软件会生成一个源语言字幕文件(SRT)。请前往视频文件所在目录下的 _video_out 子目录或软件设置的输出目录,找到对应视频的 .srt 文件,用文本编辑器打开,检查是否存在完全空白的行或内容为 None 的行,手动修正或删除这些异常行。
  2. 强制重新生成字幕:在软件主界面左上角,勾选 清理已生成 复选框,然后重新执行翻译任务。这将强制软件重新进行语音识别,生成新的字幕文件,可能规避掉之前生成的有问题的字幕。
  3. 切换翻译渠道:暂时不使用“微软翻译”渠道,尝试切换到其他翻译渠道(如“谷歌翻译”或“百度翻译”)进行测试,以确认问题是否特定于微软翻译渠道。
  4. 升级软件版本:您当前使用的版本是 v3.79。此问题可能在后续版本中已得到修复。建议访问官网下载最新版本(当前为 v3.98)的完整包或升级补丁进行覆盖更新。

请查阅相关文档:

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.

Related resource