Re: using python: crash, when importing gtk



Le dimanche 06 mai 2012 à 15:06 +0200, scrutinizer gmx at a écrit :
-------- Original-Nachricht --------
Datum: Sat, 05 May 2012 15:44:42 +0200
Von: Jean Brefort <jean brefort normalesup org>
An: scrutinizer gmx at
CC: gnumeric-list gnome org
Betreff: Re: using python: crash, when importing gtk

Le vendredi 04 mai 2012 à 07:32 +0200, scrutinizer gmx at a écrit :
-------- Original-Nachricht --------
Datum: Wed, 02 May 2012 14:06:41 +0200
Von: "Jean Bréfort" <jean brefort normalesup org>
An: scrutinizer gmx at
CC: gnumeric-list gnome org
Betreff: Re: using python: crash, when importing gtk

1.11.3 should NOT build with Python support. It should fail at
configure
stage.

Hello Jean, I don't understand why.

It should fail because things can't work currently. It does not fail
actually, and this is a bug.

You are using pygtk which depends on gtk+-2.0 from a gtk+-3.0 program,
so the crash is anticipated.


I tried using PyGI instead. A dialog appears, but then, after pressing
the ok button, gnumeric hangs.

gnumeric

/usr/lib/python2.7/dist-packages/gi/_gobject/constants.py:24: Warning:
g_boxed_type_register_static: assertion `g_type_from_name (name) == 0'
failed
  from . import _gobject

Hmm, this is clearly a bug. Something tries to initialize gobject type a
second time, and, of course, this fails. I'm suspecting this occurs
during gnm_python_init() execution. This code needs much love in order
to work. It currently imports pygtk wich is not compatible with gtk-3.


I don't know, if it is related to that. Similar things happen in 1.10.17 with gtk2.

I have two python pugins, each of them imports gtk. The first plugin works fine, but if I start the second 
one (both plugins are "gui" plugins, then a traceback appears)

import pygtk

pygtk.require('2.0')

import gtk
import Gnumeric ...

Traceback (most recent call last):
  File "transpose", line 17, in <module>
  File "/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py", line 42, in <module>
    import gdk
ImportError: No module named gdk
E Execution of module "transpose" failed.
^[[A
** (gnumeric:2108): CRITICAL **: gplp_unload_service_function_group: assertion 
`IS_GNM_PLUGIN_SERVICE_FUNCTION_GROUP (service)' failed

If I start plugin A (starts ok), then plugin B will fail. If I restart Gnumeric, first start plugin B 
(works ok), then launching plugin A will fail again with the traceback message above. 

Do you know a fix or workaround for the buggy behaviour?

No, I'm facing similar behavior with the gtk3 version (calling a python
function, and then opening the python console does not work properly). I
am not a Python expert (actually, I don't know Python at all). This
makes things difficult to analyze and fix. Just the fact that this also
occurs with 1.10 makes me think I might not have introduced a new bug)

Regards,
Jean




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