0

I want to debug some script and I followed Omid Raha suggestion from this post Writing gimp plugins in python on windows- how do i debug? where is the output?.

The system work so I am able to step into my code but this error happen when the execution reaches

from gimpfu import *

The error is :

(pythonw.exe:3588):LibGimpBase-ERROR**:gimp_wire_write_msg: the wire protocol has not been initialized

I placed at the beginning of my code file:

import rpdb2; rpdb2.start_embedded_debugger("pass")

If I comment this line and run the code without debugger it runs correctly.

Thank you

Marco

Community
  • 1
  • 1
Marco
  • 1

1 Answers1

0

GIMP plug-ins can only be run from inside GIMP itself - they won't work if they are started by an external debugging system from outside GIMP.

I don't know this "rpdb2" tool - but it suggests it is possible to attach to the running process (at least, the one "rpdb" I know of does) - so, had you tried starting your script from within GIMP and attaching the debugger later?

(The error at the import step as you show it is due to not running from inside GIMP)

jsbueno
  • 99,910
  • 10
  • 151
  • 209
  • Yes I know that GIMP plug-ins can only run from inside GIMP itself. My plug-in is started from GIMP and then (later) the external debugger is attached to the process. The Winpdb debugger runs outside GIMP and uses another pythonw.exe in a different folder; this can be the cause of the error? Thank you – Marco Jan 27 '16 at 08:26
  • Certainly it is. The error message tells exactly that: Wire protocol not initialized is a way to tell it cannot "talk" to GIMP. Keep in mind that if you can't setup debugging, you can make PDB and other calls from GIMP's interactive Python console - that is how I find out the exact semantics of the various calls. – jsbueno Jan 27 '16 at 11:43