PyFile_Type换成..? [英] PyFile_Type replaced by ..?

查看:218
本文介绍了PyFile_Type换成..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我tyring编译 Yenc 为Python 3.2。我注意到,GCC抱怨非声明的函数 PyString_Type ,所以我用它替换替换它 PyBytes_Type 作为根据文档

不过,海湾合作委员会也抱怨名为 PyFile_Type 未声明的功能。我用Google搜索了一下,发现:

 的Python 3.x的替代PyFile_Type扩展类型
与抽象接口和具体的实施的类型。
不幸的是,没有任何的这种直接可用
与C级API。

我绝不是一个C程序员,这让我无法来解决这个问题。我应该怎么做才能解决这个问题?

编辑:的rel=\"nofollow\">输出的 _

谢谢!


解决方案

简而言之,PyFile_Type已取代一些甚至没有远程在Python 3相似,你必须要么修改code自己或等待维护者来做到这一点。如果你不是一个C程序员,这将有可能是后者。 文档指出,而不是包装FILE *的,Python 3的现在封装低级别的I / O,在这种情况下,文件描述符和read()/ write()方法。

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!

解决方案

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().

这篇关于PyFile_Type换成..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆