2011-11-19 49 views
3

我正在为Python 3.2编译Yenc。我注意到海湾合作委员会抱怨说没有声明的功能PyString_Type,所以我用the documentation替代PyBytes_Type将PyFile_Type替换为..?

但是,gcc也抱怨称为PyFile_Type的未声明函数。我用Google搜索了一下,发现:

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

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

编辑:output of compilation_yenc.c

谢谢!

回答

2

简而言之,PyFile_Type已经被Python 3中甚至不是非常类似的东西所取代,您必须自己修改代码或等待维护者这样做。如果你不是C程序员,它可能必须是后者。 The documentation指出,Python 3不是包装FILE *,而是包装低级I/O,在这种情况下是文件描述符和read()/ write()。

+0

我不认为它(python-yenc)已经存在了,所以我打算用C自己摆弄下[this](http://stackoverflow.com/questions/898136/file-io-in -the-蟒-3- C-API)。 感谢您的回答! – Martijn