m13253/danmaku2ass

Crash when loading translation files (Py2 version)

persmule opened this issue · 2 comments

When convert xml danmaku to ass via danmaku2ass (py2 version) on Debian GNU/Linux Stretch, it reports:

Traceback (most recent call last):
File "../danmaku2ass2.py", line 40, in
gettext.install('danmaku2ass', os.path.join(os.path.dirname(os.path.abspath(os.path.realpath(sys.argv[0] or 'locale'))), 'locale'))
File "/usr/lib/python2.7/posixpath.py", line 73, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 11: ordinal not in range(128)

danmaku2ass (py3 version) works with no problem.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 11: ordinal not in range(128)

你没有设置系统语言,而 Danmaku2ASS 的主程序放在了含有特殊字符(如中文)的路径下了。
解决方法有两个:

  1. 设置系统语言,中文或英文皆可。编码(如果询问)填 UTF-8。
  2. 把程序放到英文字符的路径下。

如果还是无法解决,请发上来 locale 命令的输出。

Duplicate: cnbeining/Biligrab#18

$ locale
LANG=zh_CN.UTF-8
LANGUAGE=
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=