GNOME Bugzilla – Bug 678066
gdbus codegen does not work with python3
Last modified: 2012-09-29 09:00:35 UTC
I've been running into a number of issues trying to target python3 with building gnome with jhbuild. This is just one of the problems along the way.
Created attachment 216374 [details] [review] Updated codegen to work with python3 Most changes were just replacing usage of "has_key" with "in". Also updated the sorting function which was simplified and changed to a "key" function instead of "cmp" (which is no longer supported in python3. Verified everything builds with python 2.7 and 3. Note that to run jhbuild with python3 the patch given in the following ticket needs to be applied to jhbuild itself: https://bugzilla.gnome.org/show_bug.cgi?id=677979
Created attachment 216375 [details] Python Test Attached is unittest script I was using to test the sorting. I realize this was also in the C tests but having a quick python script was much easier to deal with in this case. If it is useful and can be included as part of "make check", let me know and I will submit another patch where it is hooked up to the make file.
Review of attachment 216374 [details] [review]: I can confirm that building udisks with and without this patch generates identical code. The code changes look correct to me. However, do you know of any standard annotation to say "This code runs with both Python 2 and Python 3"? Looking at: http://python3porting.com/noconv.html Hm, one thing to note is that configure.ac presently claims this code runs under Python 2.5. I wonder if you're regressing that?
I don't think running under python 2.5 is that relevant, though ?
I verified the tests also pass with python2.5. I do not know of a standard annotation for specifying compatible python versions. It would be great if the entire gnome stack could end support for anything below 2.7 (and eventually 3).
*** Bug 655623 has been marked as a duplicate of this bug. ***