GObject introspection & Python3


I am currently working to stir up some motion in getting Sugar ported
from PyGTK to PyGI. I'm trying to take all the uncertainties and
unanswered questions, solidify things and produce a solid plan for the
path forward.

One open question I have remaining is that of Python2 vs Python3.

If Sugar is going to make the shift to PyGI, it is going to break all
activities (even though we can put mechanisms in place to keep old
activities working, this is not something we would do in the long
term). We're under pressure to do this for reasons that I'm sure you
already understand.

While we don't currently have any pressure to move from Python2 to
Python3, but I presume that at some point this will become important.
This will also involve breaking all existing code. If we could combine
both painful transitions in one, the overall experience might be less

So, what is the state of PyGI + Python3? Is it expected to work? Any
major holes or things to be aware of?

Does anyone have real world experience in porting large apps to
Python3 - anything we should be particularly aware of?

As a test, I installed python3-gobject on Fedora 15 and tried to run
this test app, which works fine with Python2:

It failed as follows:

Traceback (most recent call last):
  File "wkdemo.py", line 4, in <module>
    from gi.repository import Gtk, WebKit
  File "/usr/lib/python3.2/site-packages/gi/importer.py", line 76, in
  File "/usr/lib/python3.2/site-packages/gi/module.py", line 251, in _load
    overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
  File "/usr/lib/python3.2/site-packages/gi/overrides/Gtk.py", line
400, in <module>
    class MessageDialog(Gtk.MessageDialog, Dialog):
  File "/usr/lib/python3.2/site-packages/gi/overrides/Gtk.py", line
404, in MessageDialog
  File "/usr/lib/python3.2/site-packages/gi/module.py", line 127, in __getattr__
    ascii_upper_trans = string.maketrans(
AttributeError: 'module' object has no attribute 'maketrans'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]