After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678066 - gdbus codegen does not work with python3
gdbus codegen does not work with python3
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
: 655623 (view as bug list)
Depends on:
Blocks: 684103
 
 
Reported: 2012-06-14 06:21 UTC by Simon Feltman
Modified: 2012-09-29 09:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Updated codegen to work with python3 (9.06 KB, patch)
2012-06-14 06:32 UTC, Simon Feltman
committed Details | Review
Python Test (1.47 KB, text/x-python)
2012-06-14 06:37 UTC, Simon Feltman
  Details

Description Simon Feltman 2012-06-14 06:21:47 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.
Comment 1 Simon Feltman 2012-06-14 06:32:22 UTC
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
Comment 2 Simon Feltman 2012-06-14 06:37:24 UTC
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.
Comment 3 Colin Walters 2012-06-30 14:43:59 UTC
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?
Comment 4 Matthias Clasen 2012-07-01 01:33:53 UTC
I don't think running under python 2.5 is that relevant, though ?
Comment 5 Simon Feltman 2012-07-01 07:21:25 UTC
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).
Comment 6 Simon Feltman 2012-09-29 08:41:24 UTC
*** Bug 655623 has been marked as a duplicate of this bug. ***