← Back to team overview

desktop-packages team mailing list archive

[Bug 1374993] [NEW] Libreoffice python scripting: crash on importing Gtk

 

Public bug reported:

Running libreoffice 1:4.2.6.3-0ubuntu1 on trusty.

I put a script in ~/.config/libreoffice/4/user/Scripts/python which
imports Gtk, and on importing it freezes libreoffice with this
traceback:

gabor@mycomputer:~$ loffice
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot register existing type 'GtkWidget'
  g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot add class private field to invalid type '<invalid>'
  g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot add private field to invalid (non-instantiatable) type '<invalid>'
  g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
  g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot register existing type 'GtkBuildable'
  g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
  g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_once_init_leave: assertion 'result != 0' failed
  g_type = info.get_g_type()

Steps to reproduce:
Put this minimal script in ~/.config/libreoffice/4/user/Scripts/python :

# -*- coding: utf-8 -*-

from gi.repository import Gtk

def HelloWorld():
	dialog = Gtk.MessageDialog(None, buttons=(Gtk.STOCK_OK, Gtk.ResponseType.OK), message_format="Hello World!")
	dialog.run()
	dialog.destroy()

Run it from Writer - Extras - Macros - Run macros (not sure about the
english names, LANGUAGE=C libreoffice doesn't change the language)

Result: Libreoffice freezes, doesn't react anymore.

** Affects: libreoffice (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libreoffice in Ubuntu.
https://bugs.launchpad.net/bugs/1374993

Title:
  Libreoffice python scripting: crash on importing Gtk

Status in “libreoffice” package in Ubuntu:
  New

Bug description:
  Running libreoffice 1:4.2.6.3-0ubuntu1 on trusty.

  I put a script in ~/.config/libreoffice/4/user/Scripts/python which
  imports Gtk, and on importing it freezes libreoffice with this
  traceback:

  gabor@mycomputer:~$ loffice
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot register existing type 'GtkWidget'
    g_type = info.get_g_type()
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot add class private field to invalid type '<invalid>'
    g_type = info.get_g_type()
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot add private field to invalid (non-instantiatable) type '<invalid>'
    g_type = info.get_g_type()
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
    g_type = info.get_g_type()
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: cannot register existing type 'GtkBuildable'
    g_type = info.get_g_type()
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
    g_type = info.get_g_type()
  /usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_once_init_leave: assertion 'result != 0' failed
    g_type = info.get_g_type()

  Steps to reproduce:
  Put this minimal script in ~/.config/libreoffice/4/user/Scripts/python :

  # -*- coding: utf-8 -*-

  from gi.repository import Gtk

  def HelloWorld():
  	dialog = Gtk.MessageDialog(None, buttons=(Gtk.STOCK_OK, Gtk.ResponseType.OK), message_format="Hello World!")
  	dialog.run()
  	dialog.destroy()

  Run it from Writer - Extras - Macros - Run macros (not sure about the
  english names, LANGUAGE=C libreoffice doesn't change the language)

  Result: Libreoffice freezes, doesn't react anymore.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1374993/+subscriptions


Follow ups

References