Re: GObject introspection & Python3



On Sat, Jul 9, 2011 at 13:25, Daniel Drake <dsd laptop org> wrote:
> Hi,
>
> 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
> painful.
>
> So, what is the state of PyGI + Python3? Is it expected to work? Any
> major holes or things to be aware of?

I can say it's a goal and that a fair amount of work has gone into it
already (mostly by J5 and Dave Malcolm).

> 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:
> http://dev.laptop.org/~dsd/20110625/wkdemo.py
>
> 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
> load_module
>    dynamic_module._load()
>  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
>    type=Gtk.MessageType.INFO,
>  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'

Looks like something worth fixing!

Related, if anybody happens to be able to set up a build bot, we could
regularly check that both the Python 2 and Python 3 builds pass the
test and reduce the chances of this happening in the future.

Regards,

Tomeu

> Thanks,
> Daniel
> _______________________________________________
> python-hackers-list mailing list
> python-hackers-list gnome org
> http://mail.gnome.org/mailman/listinfo/python-hackers-list
>


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