GNOME Bugzilla – Bug 584679
Python Plugins do not work in Gedit for Windows
Last modified: 2010-06-09 10:36:01 UTC
Please describe the problem: Gedit plugins written in Python do not seem to be supported in Gedit for the Windows operating system. I am currently writing some Python based plugins for Gedit for use in a cross platform office environment. Support for Python based plugins in Windows would be most appreciated. Steps to reproduce: 1. Install Gedit for Windows 2. Attempt to use a python based plugin 3. Actual results: Expected results: Does this happen every time? Other information:
I've just tried this with the shoebot plugin, and later tried the example python plugin, neither worked. The plugin appears in the list, but clicking on it causes the black text to go grey and unselectable. I've got python and pygtk installed and running ; Have tested this on Vista and XP. Plugin was installed to C:\Documents and Settings\{username}\Application Data\gedit\plugins I tried running one of the plugins using Msys and got some console output (tested with gedit 2.26.2) $ ./gedit.exe (gedit.exe:4716): Gtk-WARNING **: Could not find the icon 'system-file-manager'. The 'hicolor' theme was not found either, perhaps you need to install it. You can get a copy from: http://icon-theme.freedesktop.org/releases ** (gedit.exe:4716): WARNING **: Could not load theme icon system-file-manager: Icon 'system-file-manager' not present in theme (gedit.exe:4716): GLib-GObject-WARNING **: Two different plugins tried to register 'GeditPluginLoaderC'. (gedit.exe:4716): GLib-GObject-CRITICAL **: g_type_add_interface_dynamic: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed ** (gedit.exe:4716): WARNING **: Invalid object contained by module libcloader.dll (gedit.exe:4716): GLib-GObject-WARNING **: gtypemodule.c:112: unsolicitated invocation of g_object_dispose() on GTypeModule ** (gedit.exe:4716): WARNING **: Plugin loader module `c:\Program Files\gedit\lib\gedit-2\plugin-loaders\libcloader.dll' could not be loaded ** (gedit.exe:4716): WARNING **: Could not find loader `python' for plugin `ShoebotIt'
Python plugins are currently not supported on win32 due to a problem in building the python plugin loader. We hope to fix this soon.
*** Bug 606290 has been marked as a duplicate of this bug. ***
Some mention of this should be made on the website. Maybe here (http://projects.gnome.org/gedit/plugins.html). It would be good if users were to have some sort of explanation why some plugins are absent.
*** Bug 607867 has been marked as a duplicate of this bug. ***
I finally managed to create an installer with python support, http://www.gnome.org/~icq/gedit-setup-2.29.4-1.exe If you are intrepid and you want to report the problems you can find out please try it out. But I have to say that this is experimental and several plugins do not work or do not work properly yet.
I tried 2.29.4 and found that now externaltools and pythonconsole are listed but I cannot mark them for usage. Imho the externaltools plugin is crucial. (Are some ddls missing? I observed the same behaviour in Ubuntu using the mySQL-plugin before I installed the necessary python-mysqldb connector.) I tried most all of the other plugins. They seem to work.
The external tools will be difficult to support on windows because it does not really have a shell. It might be nice to support python tools, but I'm not sure how easy it is to get it working. The python console should just work I think, could you try to run gedit from msys and see what kind of errors you get on the terminal when you try to activate the plugin?
Created attachment 152138 [details] gedit-error-msg.txt Lines 1-13 are produces while gedit starting, lines 14-29 while trying to activate pythonconsole, the rest while trying to activate externaltools.
Ok, I just pushed a patch for the python console making it work on windows. The external tools would need more work.
I can confirm that python console now works with your new installer from todays afternoon. Typing in some simple expressions I noticed that _ does not work: >>> 123 123 >>> _*2 Traceback (most recent call last):
+ Trace 220238
r = eval(command, self.namespace, self.namespace)
Same behaviour with gedit in Ubuntu 9.04. Should I file a seperate bug report?
I suppose _ is some kind of special thing of interactive python console (it's not valid normal python). A second thing is that _ is already bound to the gettext function in gedit (which is why you get the traceback saying it's an instance method). So yes, please file a separate bug for this, although I'm not sure we will implement that feature (or when).
Where did the installer go? :) I was going to test this but the above link for the installer appears to be broken.
I moved it here: ftp://ftp.gnome.org/pub/GNOME/binaries/win32/gedit/2.29/gedit-setup-2.29.4-1.exe
I was not able to get any Python plugins to work with the Gedit version at: ftp://ftp.gnome.org/pub/GNOME/binaries/win32/gedit/2.29/gedit-setup-2.29.4-1.exe. I completely uninstalled my old version of Gedit, I removed the following folders from my user's "home directory" .gconf .gconfd Application Data\gtk-2.0 Application Data\gedit And when I start gedit.exe from a command prompt I get the following output: ------------------------------------------------------------------------- C:\Documents and Settings\me>gedit C:\Documents and Settings\me> ** (gedit.exe:720): WARNING **: libpythonloader.dll: `C:\Program Files\gedit\lib \gedit-2\plugin-loaders\libpythonloader.dll': This application has failed to sta rt because the application configuration is incorrect. Reinstalling the applicat ion may fix this problem. ** (gedit.exe:720): WARNING **: Plugin loader module `C:\Program Files\gedit\lib \gedit-2\plugin-loaders\libpythonloader.dll' could not be loaded (gedit.exe:720): Gtk-WARNING **: Could not find the icon 'system-file-manager'. The 'hicolor' theme was not found either, perhaps you need to install it. You can get a copy from: http://icon-theme.freedesktop.org/releases ** (gedit.exe:720): WARNING **: Could not load theme icon system-file-manager: I con 'system-file-manager' not present in theme -------------------------------------------------------------------------
Can anyone shed any light on the problem I am seeing in Comment 15? I'm more than happy to test/experiment. But the error message is too vague and I'm not sure where to go next. I should have mentioned that I am running Windows XP.
Well it seems like the python doesn't load for some reason for you, maybe you still have something from previous installations, I'd suggest you to try to remove gedit and try again, not sure what else I can tell you about, as it works for everyone else.
Gedit Bug Report I'm not sure if this will spark any thoughts... I used process explorer to see exactly what is happening when I attempt to load a python plugin in gedit. 3:51:09.9479352 PM gedit.exe 296 CreateFile C:\Program Files\gedit\bin\python26.dll.2.Manifest NAME NOT FOUND 3:51:09.9480869 PM gedit.exe 296 CreateFile C:\Program Files\gedit\bin\python26.dll.2.Config NAME NOT FOUND Those two lines suck out to me. It looks like we are looking for 2 resources in python26.dll that do not exist. python26.dll.2.Manifest python26.dll.2.Config python26.dll itself does indeed exist in gedit\bin I'm no sure what they are or if this is even important, but I thought I would mention it in case anyone has an idea.
@Jason: can you try to install python, and add it to your path to see if that works for you?
I installed Python 2.6.2 to c:\Python26 using default install settings. I added c:\python26 to my path. I opened a cmd.exe shell and ran Python.exe from my Desktop to ensure the path setting was correct. Sure enough it works!! :) It still works if I take c:\python26 out of my path. Apparently just having a local python install is good enough? I DID actually have a python install, but I discovered it was flawed to due an error in automatic installation. Thank you very much to everyone who helped fix this issue. An aside: Apparently bundling python26.dll with Gedit is not enough for Python plugins to work? I would have assumed otherwise. If this is unexpected then maybe the problem is that the bundled version of Python26.dll is not in the correct location?
For other people seems to work, so not sure, I think it is not missing anything but maybe I am wrong, though maybe you had messed up the system with the old python around.
I have finally done a little testing of the gedit 2.29.4 build for Windows (announced on the mailing list). Regarding plugins I have only tested xmlhelper, which is admittedly, still mentioned on the plugins page as having "test" status. It works just as it should. Regarding the Python environment, I downloaded Portable Python 3.0.1 then chose to run the included MSI, which of course made this a not-so-portable Python installation (not that this was my choice). These tests were completed on Windows XP (with Service Pack 2). Anyway I'm happy so far and will test a few more Python-based plugins. I don't know which refer to gconf, but will report my results as I test. To the developers involved, thankyou for taking the time to port (?) the application to perhaps a not-so-popular operating system.
A new version of gedit (2.30.1) has been released, can you check that it works ok?
Here's a late reply. I am successfully running gedit 2.30.1 under Windows XP SP3. From my testing so far, the official plugins work as expected, but some of the unofficial plugins produce error messages, mainly relating to gconf. Would it be useful to you for me to report the results of my testing of all plugins I'm willing to test?
gconf is becoming deprecated for 3.0, so we are not going to invest time on adding support for it on win32. So no need to add any results for it. Thanks anyway.
This bug was opened against gedit version 2.26.x in mid-2009. In comments made in this bug report, you said that Python support was yet to be enabled in gedit for Windows and in April 2010 you delivered this with 2.30.1. My tests has satisfied me that core support for Python plugins is working successfully. Issues remain with legacy plugins, some of which attempt to refer to gconf and others which simply haven't kept up with changes in gedit's structure (as I understand). I believe that this bug can be closed because the functionality which was reported as not working is now working and a later version of gedit for Windows has been released.
You're right. Thanks for the testing.