Comment 1 for bug 1779015

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

This is very interesting (and disconcerting)...

(1) On ~unmodified~ Ubuntu 18.04,
    dpkg lists the following version info for the "Vte" packages...

    $ dpkg -l gir1.2-vte-2.91 libvte-2.91-0 libvte-2.91-common

    Name Version
    ===================== =======================
    gir1.2-vte-2.91:amd64 0.52.2-1ubuntu1~18.04.1
    libvte-2.91-0:amd64 0.52.2-1ubuntu1~18.04.1
    libvte-2.91-common 0.52.2-1ubuntu1~18.04.1

    Using these versions, we get the following behavior...

    If we pass ~two~ arguments to the feed_child() function,
        terminal.feed_child("abc", -1)
    we get ~no~ error.

    If we try to pass only one argument to the feed_child() function,
        terminal.feed_child("abc")
    we get the error:
        TypeError: Vte.Terminal.feed_child() takes exactly 3 arguments (2 given)

(2) After upgrading these three packages in Ubuntu 18.04,
    dpkg lists the following version info for the same "Vte" packages...

    $ dpkg -l gir1.2-vte-2.91 libvte-2.91-0 libvte-2.91-common

    Name Version
    ===================== =======================
    gir1.2-vte-2.91:amd64 0.52.2-1ubuntu1~18.04.1
    libvte-2.91-0:amd64 0.52.2-1ubuntu1~18.04.1
    libvte-2.91-common 0.52.2-1ubuntu1~18.04.1

    Notice the version numbers are EXACTLY the same as before the upgrade.
    Using these "upgraded" versions, we get the following behavior...

    If we pass only ~one~ argument to the feed_child() function,
        terminal.feed_child("abc")
    we get ~no~ error.

    If we try to pass two arguments to the feed_child() function,
        terminal.feed_child("abc", -1)
    we get the error:
        TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

It is clear that the signature for function Vte.Terminal.feed_child() has changed.
In the previous version, it required two arguments. Now it requires one.

I was able to find an archive of a web page showing the "original" 2.91 signature:
https://web.archive.org/web/20170311221231/https://lazka.github.io/pgi-docs/Vte-2.91/classes/Terminal.html#Vte.Terminal.feed_child

(I've attached a screenshot, for posterity).

    feed_child(text, length)
      Parameters:
        text (str or None) – data to send to the child
        length (int) – length of text in bytes, or -1 if text is NUL-terminated
      Sends a block of UTF-8 text to the child as if it were entered by the user
      at the keyboard.

In the "newer" 2.91 version, feed_child() requires one argument):
https://lazka.github.io/pgi-docs/Vte-2.91/classes/Terminal.html#Vte.Terminal.feed_child

    feed_child(text)
      Parameters:
        text ([int] or None) – data to send to the child
      Sends a block of UTF-8 text to the child as if it were entered by the user
      at the keyboard.

It is disconcerting that the signature of the feed_child() function changed, but the ~version~ of Vte has remained the same! There is no way to tell if you have a library with the older version installed, or an updated library with the newer version installed!