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

hello,I've encountered an error shown below,i almost don't understand python at all ,please help #1

Closed
mccccccmike opened this issue Jul 3, 2018 · 3 comments

Comments

@mccccccmike
Copy link

python ramile-cli.py extract ../../AndroidStudioProjects/android-juli
I'm going to extract 3000 lines from ../../AndroidStudioProjects/android-juli.
Traceback (most recent call last):
File "ramile-cli.py", line 30, in
main()
File "ramile-cli.py", line 26, in main
fire.Fire(ramile_cli(), name='ramile')
File "/home/mike/.local/lib/python2.7/site-packages/fire/core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "/home/mike/.local/lib/python2.7/site-packages/fire/core.py", line 366, in _Fire
component, remaining_args)
File "/home/mike/.local/lib/python2.7/site-packages/fire/core.py", line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File "ramile-cli.py", line 12, in extract
project.run()
File "/mnt/d/www/ramile/ramile/project.py", line 34, in run
for output in file_processor.process(file):
File "/mnt/d/www/ramile/ramile/processors/init.py", line 70, in process
for output in processor.process(file):
File "/mnt/d/www/ramile/ramile/processors/init.py", line 23, in process
with open(file.file_path, 'r', encoding='utf-8') as open_file:
TypeError: 'encoding' is an invalid keyword argument for this function

@luxel
Copy link
Owner

luxel commented Jul 10, 2018

Hi buddy, sorry for the late response, have you resolved the issue?

@MrLiu199
Copy link

我这里的解决办法是:
添加上
import io
然后使用
with io.open(file.file_path, 'r', encoding='utf-8') as open_file:

@luxel
Copy link
Owner

luxel commented Nov 1, 2018

谢谢反馈,这是一个python版本兼容性问题,我把open函数都换成io.open了

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

3 participants