Python plugin gets support for Python3

Being vaguely aware that Python3 had some “interesting” differences compared to Python2, I had decided to not think about Python3 for now, but then one of our dear users piped up to say that even building it was broken! That seemed weird, so I started poking around only to find myself falling Alice-like into a Wonderland where strings were not always strings…

Well, I’ve long been interested in i18n and l10n in all their forms, especially as they apply to Indic languages, so I was somewhat aware of the sorts of issues that Unicode can throw up. Luckily, as a KDE developer I’m used to depending on QString handle all the routine grunt work so it was a bit of a rude awakening to discover that, the C API for Python strings takes many forms:

The cmake support in KDE before 4.9.4 cannot find the right libraries.

The PyKDE4 support for strings was broken-then-fixed.

Python3 pickles structures differently than Python2.

Anyway, with some excellent support from Luca Beltrame and Alex Turbov, I’m glad to say that Pate and its plugins should now work with any of Python 2.x, <= 3.2, or 3.3 in the upcoming 4.9.4 and 4.10 releases. Thanks Luca and Alex!

The Pate mentioned here started life as the plugin you saw on github. It has been updated/integrated/upgraded into Kate’s main codebase, and so is available in the various KDE 4.10 release candidates now available. Install one of those, or wait for the 4.10 release.