gpt4 book ai didi

c - PyFile_Type 替换为 ..?

转载 作者:行者123 更新时间:2023-12-02 02:21:01 25 4
gpt4 key购买 nike

我正在编译 Yenc对于 Python 3.2。我注意到 gcc 提示一个未声明的函数 PyString_Type,所以我根据 the documentation 将其替换为它的替换 PyBytes_Type .

但是,gcc 还提示名为 PyFile_Type 的未声明函数。我用谷歌搜索了一下,发现:

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

谢谢!

最佳答案

简而言之,PyFile_Type 已被 Python 3 中的某些东西所取代,您将不得不自己修改代码或等待维护者这样做。如果您不是 C 程序员,则可能必须是后者。 The documentation指出 Python 3 现在不再包装 FILE*,而是包装低级 I/O,在本例中为文件描述符和 read()/write()。

关于c - PyFile_Type 替换为 ..?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8195383/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com