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

export_stardict 方法写文件错误 #91

Open
passos opened this issue Jul 25, 2022 · 3 comments
Open

export_stardict 方法写文件错误 #91

passos opened this issue Jul 25, 2022 · 3 comments

Comments

@passos
Copy link

passos commented Jul 25, 2022

Python 3.7.5

Source code

import stardict
import dictutils

dictionary = stardict.open_dict('ecdict.mini.csv')
dictutils.generator.compile_stardict(dictionary, 'sd', 'sd')

Error

Traceback (most recent call last):
  File "/Users/jinyuliu/workspace/ECDICT/dictutils.py", line 1062, in <module>
    generator.compile_stardict(dictionary, 'sd', 'sd')
  File "/Users/jinyuliu/workspace/ECDICT/dictutils.py", line 203, in compile_stardict
    stardict.tools.export_stardict(out, filename, title)
  File "/Users/jinyuliu/workspace/ECDICT/stardict.py", line 1372, in export_stardict
    f3.write("StarDict's dict ifo file\nversion=2.4.2\n")
TypeError: a bytes-like object is required, not 'str'
@skywind3000
Copy link
Owner

自己改一下啊,这个函数里 py2 代码还没改干净。

@passos
Copy link
Author

passos commented Jul 26, 2022 via email

@skywind3000
Copy link
Owner

你多心了,没有半点嫌弃的意思,最近我比较忙,仅此而已,可能要等比较久才有空看,
所以你着急用的话,建议自己立马改一下。

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