I'm building kate from the 4.10beta1 tarball, and the build fails with: [ 93%] Building CXX object kate/plugins/pate/src/CMakeFiles/pateplugin.dir/plugin.o In file included from /usr/include/python3.3m/pytime.h:6:0, from /usr/include/python3.3m/Python.h:65, from /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.h:32, from /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:21: /usr/include/python3.3m/object.h:432:23: error: expected unqualified-id before ‘;’ token /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘virtual QString Pate::Plugin::configPageName(uint) const’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:200:34: error: ‘PyString_AsString’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘virtual QString Pate::Plugin::configPageFullName(uint) const’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:216:38: error: ‘PyString_AsString’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘void Pate::ConfigPage::infoTopicChanged(int)’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:356:67: error: ‘PyString_AsString’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:373:71: error: ‘PyString_AsString’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘void Pate::ConfigPage::infoPluginActionsChanged(int)’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:402:48: error: ‘PyString_AsString’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:405:35: error: ‘PyString_Check’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:408:72: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘void Pate::ConfigPage::infoPluginConfigPagesChanged(int)’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:435:48: error: ‘PyString_AsString’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:439:35: error: ‘PyString_Check’ was not declared in this scope /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘virtual QString Pate::Plugin::configPageFullName(uint) const’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:217:1: error: control reaches end of non-void function [-Werror=return-type] /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp: In member function ‘virtual QString Pate::Plugin::configPageName(uint) const’: /build/src/kate-4.9.80/kate/plugins/pate/src/plugin.cpp:201:1: error: control reaches end of non-void function [-Werror=return-type] cc1plus: some warnings being treated as errors make[2]: *** [kate/plugins/pate/src/CMakeFiles/pateplugin.dir/plugin.o] Error 1 make[1]: *** [kate/plugins/pate/src/CMakeFiles/pateplugin.dir/all] Error 2 make: *** [all] Error 2 KDE 4.9.80 PyQt 4.9.5 Python 3.3.0
Justed compiled it here, seems to work. Problem with Python 2.x vs. 3.x?
(In reply to comment #1) > Justed compiled it here, seems to work. Problem with Python 2.x vs. 3.x? It does indeed seem to be a Python 3 issue. Not being an expert, I did a bit of Gooling and it seems that Python 3 support is still immature, so I am seeking advice on whether there is a reasonable way for me to proceed, or whether this just has to wait. (I cannot remove Python2 from my systems without major breakage it seems). Andrea, do you have the Python 2 development libraries installed? Or is there some reason you *must* have Python3?
I didn't know this was supposed to don't work with Py3. Builds fine with -DPYTHON_EXECUTABLE=/usr/bin/python2
I have the impression that Python3 support generally, across the Python world is coming, but not yet common by any means. For example, the KDE build system is being updated to support it. One there is a bit more infrastructure in place, I hope to support it. On 17 November 2012 12:02, Andrea Scarpino <andrea@archlinux.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=310220 > > --- Comment #3 from Andrea Scarpino <andrea@archlinux.org> --- > I didn't know this was supposed to don't work with Py3. > > Builds fine with -DPYTHON_EXECUTABLE=/usr/bin/python2 > > -- > You are receiving this mail because: > You are the assignee for the bug.
It looks to me as a clash between "slots" as defined in Python 3's object.h and the "slots" used in plugin.h. Does it work if instead of "slots" the Q_SLOTS macro is used?
I found the actual error. The functions used are renamed in python3 (from PyString to PyBytes), so it will need some adjustments (and probably #ifdef'ing).
FYI, patch in progress. I should be done before the end of the weekend, I hope.
Patch is up for review: https://git.reviewboard.kde.org/r/107362/ - notice that I only tested compile time.
Thanks Luca...see review. Commit and I'll make sure it works etc. and refactor the C++ aspects. On 18 November 2012 08:26, Luca Beltrame <lbeltrame@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=310220 > > --- Comment #8 from Luca Beltrame <lbeltrame@kde.org> --- > Patch is up for review: https://git.reviewboard.kde.org/r/107362/ - notice that > I only tested compile time. > > -- > You are receiving this mail because: > You are the assignee for the bug.
Git commit 9b937109adb858100f8021bc8849ed57ccc645ad by Luca Beltrame. Committed on 18/11/2012 at 23:43. Pushed by lbeltrame into branch 'master'. Fix building Pate with Python 3. Python's C API changed a lot between version 2 and 3, and in particular Python 3.2 removed a lot of the old CObject API. At the moment simultaneous compatibility is achieved by a series of #if blocks, possibly some refactoring is in order. Pate builds with both Python 2 and Python 3 now. REVIEW: 107362 M +21 -1 kate/plugins/pate/src/engine.cpp M +45 -0 kate/plugins/pate/src/plugin.cpp M +3 -2 kate/plugins/pate/src/plugin.h M +32 -0 kate/plugins/pate/src/utilities.cpp http://commits.kde.org/kate/9b937109adb858100f8021bc8849ed57ccc645ad