PyFile_Type replaced by ..?

試著忘記壹切 提交于 2019-12-22 10:12:59

问题


I'm tyring to compile Yenc for Python 3.2. I noticed that gcc complained about a non-declared function PyString_Type, so I replaced it with its replacement PyBytes_Type as according to the documentation.

However, gcc also complained about an undeclared function called PyFile_Type. I googled a bit and found:

Python 3.x replaces the PyFile_Type extension type 
with an abstract interface and specific implementation types. 
Unfortunately it doesn't make any of this directly available 
with a C level api.

source

I am by no means a C-programmer, which leaves me unable to solve this issue. What should I do to solve this?

Edit: output of compilation, _yenc.c

Thanks!


回答1:


Simply put, PyFile_Type has been replaced by something not even remotely similar in Python 3, and you'll have to either modify the code yourself or wait for the maintainer to do that. If you're not a C programmer, it'll likely have to be the latter. The documentation states that rather than wrapping FILE*'s, Python 3 now wraps low-level I/O, in this case file descriptors and read()/write().



来源:https://stackoverflow.com/questions/8195383/pyfile-type-replaced-by

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!