rockowitz / ddcutil

Control monitor settings using DDC/CI and USB
http://www.ddcutil.com
GNU General Public License v2.0
946 stars 38 forks source link

Multiple unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? errors #42

Closed dracwyrm closed 6 years ago

dracwyrm commented 6 years ago

Hi

In src/swig/ddc_swig.h and ddc_swig.cpp I'm getting these errors:

src/swig/ddc_swig.h:92:31: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? void save_current_python_fout(PyFileObject * pfy);
src/swig/ddc_swig.h:93:1: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’?PyFileObject * get_current_python_fout();
ddc_swig.c:154:8: error: unknown type name ‘PyFileObject’ static PyFileObject * current_python_fout;
ddc_swig.c:156:31: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? void save_current_python_fout(PyFileObject * pfy) {
ddc_swig.c:161:1: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? PyFileObject * get_current_python_fout() {

Python: 3.5.4 Swig: 3.0.12 Cffi: 1.11.2 Cython: 0.26.1

rockowitz commented 6 years ago

Hi Jonathan,

Run configure with --disable-swig, --disable-cython --disable-cffi --disable-gobject (These are the default settings.)

The Python code in the source tree is all experimental proof of concept explorations, so didn't get full attention in pushing out the release. None of it is meant for public use.

Nonetheless, thanks for pointing out the errors.  The handling of FILE object changed between Python 2 and Python 3.  Looks like the testing for Py2 vs 3 isn't quite right.

Regards, Sanford

On 01/20/2018 04:37 AM, Jonathan Scruggs wrote:

Hi

In src/swig/ddc_swig.h and ddc_swig.cpp I'm getting these errors:

|src/swig/ddc_swig.h:92:31: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? void save_current_python_fout(PyFileObject pfy); src/swig/ddc_swig.h:93:1: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? PyFileObject get_current_python_fout(); ddc_swig.c:154:8: error: unknown type name ‘PyFileObject’ static PyFileObject current_python_fout; ddc_swig.c:156:31: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? void save_current_python_fout(PyFileObject pfy) { ddc_swig.c:161:1: error: unknown type name ‘PyFileObject’; did you mean ‘PyCodeObject’? PyFileObject * get_current_python_fout() { |

Python: 3.5.4 Swig: 3.0.12 Cffi: 1.11.2 Cython: 0.26.1

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcutil/issues/42, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhsblsg-lBB2xd37GMDmX9KlAyHWmtnks5tMbPxgaJpZM4RlYC6.

dracwyrm commented 6 years ago

@rockowitz I disabled those and it builds fine.

I did look at the code and noticed that the line that errors is surrounded by a version test, but for some reason that didn't work right to prevent it from executing. The comment said there was no function like that in Python 3, which just makes it harder. There's a couple of workarounds that I found, but don't know if they would work for you.

I'll right for you to declare python safe for a public API before trying to enable it in the Gentoo Ebuilds. :) Thanks for responding to this report.