Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win下。。。一步一步调试中,错误很多。。。 #3

Open
Howard-guo opened this issue Jan 25, 2019 · 2 comments
Open

win下。。。一步一步调试中,错误很多。。。 #3

Howard-guo opened this issue Jan 25, 2019 · 2 comments

Comments

@Howard-guo
Copy link

Howard-guo commented Jan 25, 2019

1、要把opencc的配置文件放到当前目录下,不然找不到
2、windows要把opencc命令行,-i 和-o后面的单引号去掉,不然报错
3、rename到原文件之前,要把原文件删掉或改名,不然报错
4、下面的错误不知道是什么原因,45行会报这个错,但是如果我把要转换的text打印一下,这个错误就不会出。。。很神奇
5、最后,这里要改成这样:p = subprocess.Popen(cmd_args, cwd="./")

以下是第4点的报错信息:

D:\workpad\py\opf-cc>opf-cc.py MZDZZSM.mobi
Converting file: MZDZZSM\MZDZZSM.opf
Converting file: MZDZZSM\MZDZZSM.html
Converting file: MZDZZSM\MZDZZSM.ncx
Traceback (most recent call last):
File "D:\workpad\py\opf-cc\opf-cc.py", line 177, in
convert_files_in_place(converter, files)
File "D:\workpad\py\opf-cc\opf-cc.py", line 100, in convert_files_in_place
text.text = converter.convert(text.text.encode('utf-8')).decode('utf-8')
File "D:\workpad\py\opf-cc\opencc.py", line 45, in convert
retv_c = self.libopencc.opencc_convert_utf8(self.od, text, len(text))
WindowsError: [Error -529697949] Windows Error 0xE06D7363

@Howard-guo Howard-guo changed the title crash了,问题不明 无法输出文件?不懂 Jan 25, 2019
@Howard-guo Howard-guo changed the title 无法输出文件?不懂 win下。。。一步一步调试中,错误很多。。。 Jan 25, 2019
@zhangbo-miuNEST
Copy link

今天我也遇到了1、2、3的问题,debug搞定了。

@zhangbo-miuNEST
Copy link

第4点可能因为windows上的epub/mobi的路径名包含中文的吧。我把目录名、文件名改为英文就没问题。

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

No branches or pull requests

2 participants