After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584679 - Python Plugins do not work in Gedit for Windows
Python Plugins do not work in Gedit for Windows
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.26.x
Other Windows
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 606290 607867 (view as bug list)
Depends on: 562790 589671
Blocks:
 
 
Reported: 2009-06-03 01:44 UTC by Jason
Modified: 2010-06-09 10:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gedit-error-msg.txt (2.03 KB, text/plain)
2010-01-24 12:44 UTC, Volker van Nek
Details

Description Jason 2009-06-03 01:44:35 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:
Comment 1 Stuart Axon 2009-06-29 16:22:48 UTC
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'
Comment 2 jessevdk@gmail.com 2009-06-29 16:31:37 UTC
Python plugins are currently not supported on win32 due to a problem in building the python plugin loader. We hope to fix this soon.
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-01-07 09:33:02 UTC
*** Bug 606290 has been marked as a duplicate of this bug. ***
Comment 4 s.g.mcateer 2010-01-07 21:16:22 UTC
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.
Comment 5 Ignacio Casal Quinteiro (nacho) 2010-01-23 13:42:08 UTC
*** Bug 607867 has been marked as a duplicate of this bug. ***
Comment 6 Ignacio Casal Quinteiro (nacho) 2010-01-23 23:58:58 UTC
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.
Comment 7 Volker van Nek 2010-01-24 11:46:34 UTC
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.
Comment 8 jessevdk@gmail.com 2010-01-24 11:55:16 UTC
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?
Comment 9 Volker van Nek 2010-01-24 12:44:45 UTC
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.
Comment 10 jessevdk@gmail.com 2010-01-24 14:07:54 UTC
Ok, I just pushed a patch for the python console making it work on windows. The external tools would need more work.
Comment 11 Volker van Nek 2010-01-24 18:47:53 UTC
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):
  • File "C:\Programme\gedit\lib\gedit-2\plugins\pythonconsole\console.py", line 298 in __run
    r = eval(command, self.namespace, self.namespace)
  • File "<string>", line 1 in <module>
TypeError: unsupported operand type(s) for *: 'instancemethod' and 'int'

Same behaviour with gedit in Ubuntu 9.04. Should I file a seperate bug report?
Comment 12 jessevdk@gmail.com 2010-01-24 19:01:49 UTC
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).
Comment 13 Jason 2010-01-25 17:16:43 UTC
Where did the installer go? :)  

I was going to test this but the above link for the installer appears to be broken.
Comment 14 Ignacio Casal Quinteiro (nacho) 2010-01-25 17:19:23 UTC
I moved it here:
ftp://ftp.gnome.org/pub/GNOME/binaries/win32/gedit/2.29/gedit-setup-2.29.4-1.exe
Comment 15 Jason 2010-01-27 15:26:21 UTC
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
-------------------------------------------------------------------------
Comment 16 Jason 2010-02-02 14:33:24 UTC
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.
Comment 17 Ignacio Casal Quinteiro (nacho) 2010-02-02 14:46:03 UTC
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.
Comment 18 Jason 2010-02-19 21:10:38 UTC
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.
Comment 19 Ignacio Casal Quinteiro (nacho) 2010-02-22 12:38:46 UTC
@Jason: can you try to install python, and add it to your path to see if that works for you?
Comment 20 Jason 2010-02-22 16:26:14 UTC
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?
Comment 21 Ignacio Casal Quinteiro (nacho) 2010-02-22 16:33:35 UTC
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.
Comment 22 phayz 2010-03-02 21:42:26 UTC
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.
Comment 23 Ignacio Casal Quinteiro (nacho) 2010-04-18 20:08:55 UTC
A new version of gedit (2.30.1) has been released, can you check that it works ok?
Comment 24 phayz 2010-06-09 03:20:09 UTC
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?
Comment 25 Ignacio Casal Quinteiro (nacho) 2010-06-09 07:52:00 UTC
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.
Comment 26 phayz 2010-06-09 10:16:16 UTC
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.
Comment 27 Ignacio Casal Quinteiro (nacho) 2010-06-09 10:17:56 UTC
You're right. Thanks for the testing.