Issue when using Vte.Terminal.feed_child
Hello,
I have an issue using the feed_child
method of the Vte.Terminal
class: it seems that the implicit self
reference is counted as a GI argument that will passed to the underlying C function.
I can reproduce this issue on Archlinux and Fedora 28 but not on Ubuntu 18.04. The only difference I found between working and non-working distro is the GI version (3.26 vs 3.28).
I wrote a minimal code to reproduce the issue and that prints some additional information:
#!/usr/bin/env python
import gi
gi.require_version("Gtk", "3.0") # noqa
gi.require_version("Vte", "2.91") # noqa
from gi.repository import GLib, Gtk, Vte
CMD = "echo hello\n"
# Print some infos
print("GI VERSION: %i.%i.%i" % gi.version_info)
print("GLIB VERSION: %i.%i.%i" % GLib.glib_version)
print("VTE VERSION: %i.%i.%i" % (
Vte.get_major_version(),
Vte.get_minor_version(),
Vte.get_micro_version()))
print("ARGUMENTS: Vte.Terminal.feed_child%s" % str(
Vte.Terminal.feed_child.get_arguments()))
# Test case
win = Gtk.Window(title="Vte Terminal feed_child test")
win.connect("destroy", Gtk.main_quit)
term = Vte.Terminal()
win.add(term)
win.show_all()
term.spawn_sync(
Vte.PtyFlags.DEFAULT, None, ["/bin/sh"],
None, GLib.SpawnFlags.SEARCH_PATH, None, None)
term.feed_child(CMD, len(CMD))
Gtk.main()
on Ubuntu 18.04 (works):
GI VERSION: 3.26.1
GLIB VERSION: 2.56.1
VTE VERSION: 0.52.1
ARGUMENTS: Vte.Terminal.feed_child(gi.ArgInfo(text), gi.ArgInfo(length))
on ArchLinux / Fedora 28 (does not work):
GI VERSION: 3.28.2
GLIB VERSION: 2.56.1
VTE VERSION: 0.52.1
ARGUMENTS: Vte.Terminal.feed_child(gi.ArgInfo(text), gi.ArgInfo(length))
Traceback (most recent call last):
File "vte_terminal_feed_child.py", line 35, in <module>
term.feed_child(CMD, len(CMD))
I hope I posted this issue on the right project :)