Plugins written in Python can no longer be enabled

Bug #839712 reported by jpfle
54
This bug affects 11 people
Affects Status Importance Assigned to Milestone
gedit (Ubuntu)
Invalid
Undecided
Unassigned
gedit-plugins (Ubuntu)
Invalid
Undecided
Unassigned
libpeas (Ubuntu)
Fix Released
High
Martin Pitt
pygobject (Ubuntu)
Invalid
Undecided
Unassigned
pygobject-2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I updated to Ubuntu 11.10 Beta 1, and I can no longer enable gedit plugins written in Python. When I go to "Edit > Preferences > Plugins" and I try to enable such a plugin, the checkbox is greyed out. Here's the output on a terminal when I try to enable Snippets:

(gedit:19196): libpeas-WARNING **: Error initializing Python interpreter: could not import gi
(gedit:19196): libpeas-WARNING **: Please check the installation of all the Python related packages required by libpeas and try again
(gedit:19196): libpeas-WARNING **: Cannot load Python plugin 'snippets' since libpeas was not able to initialize the Python interpreter
(gedit:19196): libpeas-WARNING **: Error loading plugin 'snippets'

I didn't have this bug with Ubuntu 11.10 Alpha 3.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gedit 3.1.4-0ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-9.15-generic 3.0.3
Uname: Linux 3.0.0-9-generic i686
Architecture: i386
Date: Fri Sep 2 12:27:29 2011
ExecutablePath: /usr/bin/gedit
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
SourcePackage: gedit
UpgradeStatus: Upgraded to oneiric on 2011-08-23 (10 days ago)

Revision history for this message
jpfle (jpfle) wrote :
Changed in gedit (Ubuntu):
status: New → Confirmed
Changed in gedit-plugins (Ubuntu):
status: New → Confirmed
Changed in libpeas (Ubuntu):
status: New → Confirmed
Revision history for this message
John M (jwmwalrus) wrote :

I noticed that's due to the new version of python-gobject package. Funnily, that package also seems to break apport itself (at least in my computer).

Changed in pygobject (Ubuntu):
status: New → Confirmed
Changed in pygobject-2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Curtis Hovey (sinzui) wrote :

There is a parallel conversation at https://bugzilla.redhat.com/show_bug.cgi?id=732855 that indicates the upstream pygobject3 and libpeas were updated on 2011-09-02

Revision history for this message
Stojan Dimitrovski (sdimitrovski) wrote :

Just a side note, as I have gone to determine why the plugins won't activate, I discovered that running "python2.7 -c "from gi.repository import Gedit" fails, but running "python3 -c "from gi.repository import Gedit" doesn't. I am assuming it could be the way libpeas/gedit is linked to Python, and/or the version of the interpreter that it loads. I can also see that gedit depends on python 2.7.

When I try to activate the "Bracket Completion" plugin, gedit outputs this:
(gedit:25444): Gtk-CRITICAL **: gtk_accel_label_set_accel_closure: assertion `gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed

(gedit:25444): libpeas-WARNING **: Error initializing Python interpreter: could not import gi

(gedit:25444): libpeas-WARNING **: Please check the installation of all the Python related packages required by libpeas and try again

(gedit:25444): libpeas-WARNING **: Cannot load Python plugin 'bracketcompletion' since libpeas was not able to initialize the Python interpreter

(gedit:25444): libpeas-WARNING **: Error loading plugin 'bracketcompletion'

This could mean that the python "gi" module is probably written for python 3, but not python 2.7.

Hope this helps.

Martin Pitt (pitti)
Changed in gedit (Ubuntu):
status: Confirmed → Invalid
Changed in gedit-plugins (Ubuntu):
status: Confirmed → Invalid
Changed in pygobject-2 (Ubuntu):
status: Confirmed → Invalid
Changed in pygobject (Ubuntu):
status: Confirmed → Invalid
Changed in libpeas (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
assignee: nobody → Martin Pitt (pitti)
milestone: none → ubuntu-11.10-beta-2
Martin Pitt (pitti)
Changed in libpeas (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libpeas - 1.1.3-0ubuntu1

---------------
libpeas (1.1.3-0ubuntu1) oneiric; urgency=low

  [ Martin Pitt ]
  * New upstream release:
    - Link against pygobject 3. (LP: #839712)
    - Do not cast pointers to unsigned integers.
  * Drop debian/patches/gint_is_not_gtype, upstream now.
  * debian/control.in: Bump python-gobject-dev build dependency to >= 2.90 as
    per upstream configure.ac.
  * debian/control.in: Move valac-0.12 to valac to use 0.14.

  [ Oliver Sauder ]
  * Added peas-gtk vapi file libpeas-gtk-1.0.vapi (LP: #825834)
 -- Martin Pitt <email address hidden> Mon, 05 Sep 2011 08:41:48 +0200

Changed in libpeas (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
jpfle (jpfle) wrote :

@Martin: I updated packages. Plugins written in Python now can be enabled, but a lot can not be used. For example, if I enable "Snippets" and then go to "Tools > Manage Snippets...", nothing happens and the following error is displayed on the terminal:

TypeError: on_action_snippets_activate() takes exactly 3 arguments (2 given)

I have this error for other plugins, for example:

- "External Tools": TypeError: <lambda>() takes exactly 2 arguments (1 given)
- "Advanced Find/Replace": TypeError: advanced_find_active() takes at least 3 arguments (2 given)

Revision history for this message
Tobias Wolf (towolf) wrote :

See also bug #818857

Revision history for this message
Martin Pitt (pitti) wrote :

Right, these are now bugs in the actual plugins. gedit is at 3.1.4, gedit-plugins at 3.1.2, both need to be updated to current versions which will certainly fix a lot of these bugs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.